You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Navigating to the route where next being served on monorepo example (eg: localhost:3000/about) will produce following error
Error: Cannot find module '../../ui/node_modules/next/dist/next-server/lib/constants.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:613:15)
at Function.Module._load (internal/modules/cjs/loader.js:539:25)
at Module.require (internal/modules/cjs/loader.js:667:17)
at require (internal/modules/cjs/helpers.js:20:18)
at eval (webpack-internal:///../next-server/lib/constants:1:18)
at Object.../next-server/lib/constants (/Users/xxxx/nest-next/examples/monorepo/ui/.next/server/pages/_document.js:103:1)
at __webpack_require__ (/Users/xxxx/nest-next/examples/monorepo/ui/.next/server/pages/_document.js:23:31)
at eval (webpack-internal:///./node_modules/next/dist/pages/_document.js:20:18)
at Object../node_modules/next/dist/pages/_document.js (/Users/xxxx/nest-next/examples/monorepo/ui/.next/server/pages/_document.js:148:1)
at __webpack_require__ (/Users/xxxx/nest-next/examples/monorepo/ui/.next/server/pages/_document.js:23:31) code: 'MODULE_NOT_FOUND' }
Expected behavior
No error produced and the route serve the right component from nextjs
To Reproduce
Clone this repo and run the example
Build uidto and server first (there is missing @types/webpack dependency, so i install it to ensure successful build)
run npm run dev on server
enter localhost:3000 or localhost:3000/about
the page failed to load and following error is displayed in the server output
Error: Cannot find module '../../ui/node_modules/next/dist/next-server/lib/constants.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:613:15)
at Function.Module._load (internal/modules/cjs/loader.js:539:25)
at Module.require (internal/modules/cjs/loader.js:667:17)
at require (internal/modules/cjs/helpers.js:20:18)
at eval (webpack-internal:///../next-server/lib/constants:1:18)
at Object.../next-server/lib/constants (/Users/xxxx/nest-next/examples/monorepo/ui/.next/server/pages/_document.js:103:1)
at __webpack_require__ (/Users/xxxx/nest-next/examples/monorepo/ui/.next/server/pages/_document.js:23:31)
at eval (webpack-internal:///./node_modules/next/dist/pages/_document.js:20:18)
at Object../node_modules/next/dist/pages/_document.js (/Users/xxxx/nest-next/examples/monorepo/ui/.next/server/pages/_document.js:148:1)
at __webpack_require__ (/Users/xxxx/nest-next/examples/monorepo/ui/.next/server/pages/_document.js:23:31) code: 'MODULE_NOT_FOUND' }
Version
next.js: 9.1.6
nest: 6.10.12
nest-next: 9.1.0
The text was updated successfully, but these errors were encountered:
Also had this, was gone when I upgraded the dependencies, in particular next to 9.4.4 (but not the newest as it was failing with yet another esoteric error).
@kyle-mccarthy
I think we can close this issue. After further investigation, following @NOtherDev tips works and it's indeed NextJS issue.
Thanks for taking your time to look at this issue 👍
Describe the bug
Navigating to the route where next being served on monorepo example (eg:
localhost:3000/about
) will produce following errorExpected behavior
No error produced and the route serve the right component from nextjs
To Reproduce
ui
dto
andserver
first (there is missing@types/webpack
dependency, so i install it to ensure successful build)npm run dev
onserver
localhost:3000
orlocalhost:3000/about
Version
The text was updated successfully, but these errors were encountered: