Next.js: update next version from 7 to 8, can not resolve _document.js file?

Created on 22 Feb 2019  Â·  5Comments  Â·  Source: vercel/next.js

when I want to update next to version 8.0.2, I got this problem:

Can't resolve 'private-next-pages/_document.js' in ...(my project folder);

help me~

Most helpful comment

@forMine I think you have to change config.resolve.alias = { 'xx': 'yy' } to config.resolve.alias = { ...config.resolve.alias, xx: 'yy' }

All 5 comments

@forMine i got this problem too but in my project is can't resolve 'private-next-pages/_app.tsx'

@forMine i got this problem too but in my project is can't resolve 'private-next-pages/_app.tsx'

I delete the webpack config about "config.resolve.alias" and this problem disappeard
but I got a new problem:
Cannot find module '../core-js/object/define-property'

Please follow the issue template and provide a clear and concise reproduction. It's really hard to help with the issue in your particular application without being able to reproduce.

@forMine I think you have to change config.resolve.alias = { 'xx': 'yy' } to config.resolve.alias = { ...config.resolve.alias, xx: 'yy' }

Maybe webpack. resolve conflicts with the default configuration. I also configure webpack. resolve. alias and then can't resolve'private-next-pages/_document. tsx'. The solution is to downgrade the next version to 7.0.2 or to set alias without using webpack. resolve instead of using babel-plugin-module-resolver.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

swrdfish picture swrdfish  Â·  3Comments

wagerfield picture wagerfield  Â·  3Comments

rauchg picture rauchg  Â·  3Comments

sospedra picture sospedra  Â·  3Comments

ghost picture ghost  Â·  3Comments