Next.js: Module not found: Can't resolve 'private-next-pages/about.js'

Created on 16 Sep 2019  路  1Comment  路  Source: vercel/next.js

Bug report

When I try to build I get the following error:

Module not found: Can't resolve 'private-next-pages/about.js'

Then build fails.

To Reproduce

  1. Create a page named about.js with a component exported.
  2. Try to build.

Expected behavior

My application built

System information

  • MacOS
  • Chrome
  • Next.js v9

Most helpful comment

I just solved! The problem was with my next.config.js, I overwritten config.resolve.alias in the wrong way. The correct way is:

config.resolve.alias = {
  ...config.resolve.alias,
  ...myWebpackConfig.resolve.alias,
}

Just ;)

>All comments

I just solved! The problem was with my next.config.js, I overwritten config.resolve.alias in the wrong way. The correct way is:

config.resolve.alias = {
  ...config.resolve.alias,
  ...myWebpackConfig.resolve.alias,
}

Just ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jesselee34 picture jesselee34  路  3Comments

olifante picture olifante  路  3Comments

YarivGilad picture YarivGilad  路  3Comments

rauchg picture rauchg  路  3Comments

lixiaoyan picture lixiaoyan  路  3Comments