Next.js: Missing deps in package.json

Created on 10 Mar 2019  路  5Comments  路  Source: vercel/next.js

Bug report

Describe the bug

Module not found: Error: Can't resolve 'react-is' in '/xxx/node_modules/.registry.npmjs.org/next-server/8.0.4-canary.9/node_modules/next-server/dist/lib/router'

Also @babel/runtime-corejs2 in next-server.

To Reproduce

Occurs when using pnpm which expects explicit deps (no hoisting).

Expected behavior

Screenshots

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of Next.js: [e.g. 6.0.2] 8.0.4-canary.9

Additional context

Workaround

Install deps in app root.

bug

Most helpful comment

This isn't an issue with Next.js

Yes it is. Something is being required that is not specified in the closest package.json. This is non-standard, and could cause many issues later on. It also won't support yarn pnp.

All 5 comments

This isn't an issue with Next.js

This isn't an issue with Next.js

Yes it is. Something is being required that is not specified in the closest package.json. This is non-standard, and could cause many issues later on. It also won't support yarn pnp.

edit: Will update for proper version

ESLint project recommended these:

https://github.com/mysticatea/eslint-plugin-node

node/no-extraneous-import | disallow聽import聽declarations of extraneous packages | 聽
-- | -- | --
node/no-extraneous-require | disallow聽require()聽expressions of extraneous packages | 猸愶笍
node/no-missing-import | disallow聽import聽declarations of missing files | 聽
node/no-missing-require | disallow聽require()聽expressions of missing files

Afaik this was fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timneutkens picture timneutkens  路  250Comments

Knaackee picture Knaackee  路  122Comments

baldurh picture baldurh  路  74Comments

dunika picture dunika  路  58Comments

Timer picture Timer  路  60Comments