[12.0.4-canary.2], Preact - Local dev server fails with Error: Cannot find module 'scheduler/package.json'
See original GitHub issueWhat version of Next.js are you using?
12.0.4-canaray.2 to 12.0.4-canaray.4
What version of Node.js are you using?
14.17.6
What browser are you using?
chrome
What operating system are you using?
macOS
How are you deploying your application?
.
Describe the Bug
Local dev server stops with an error: Error: Cannot find module 'scheduler/package.json'
.
I assume this comes in relation with the recent changes in this line in webocket-config.js.
I believe we scheduler
must be removed from topLevelFrameworkPaths
to make it work correctly.
Complete error:
Error: Cannot find module 'scheduler/package.json'
Require stack:
- /Users/<path>/node_modules/next/dist/build/webpack-config.js
- /Users/<path>/node_modules/next/dist/server/dev/hot-reloader.js
- /Users/<path>/node_modules/next/dist/server/dev/next-dev-server.js
- /Users/<path>/node_modules/next/dist/server/next.js
- /Users/<path>/node_modules/next/dist/server/lib/start-server.js
- /Users/<path>/node_modules/next/dist/cli/next-dev.js
- /Users/<path>/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.mod._resolveFilename (/Users//<path>/node_modules/next/dist/build/webpack/require-hook.js:171:28)
at Function.resolve (internal/modules/cjs/helpers.js:98:19)
at getPackagePath (/Users/<path>/node_modules/next/dist/build/webpack-config.js:601:41)
at Object.getBaseWebpackConfig [as default] (/Users/<path>/node_modules/next/dist/build/webpack-config.js:619:9)
at async Promise.all (index 0)
at async Span.traceAsyncFn (/Users/<path>/node_modules/next/dist/trace/trace.js:74:20)
at async Span.traceAsyncFn (/Users/<path>/node_modules/next/dist/trace/trace.js:74:20)
at async HotReloader.start (/Users/n<path>/node_modules/next/dist/server/dev/hot-reloader.js:325:25)
at async DevServer.prepare (/Users/<path>/node_modules/next/dist/server/dev/next-dev-server.js:290:9) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/<path>/node_modules/next/dist/build/webpack-config.js',
'/Users/<path>/node_modules/next/dist/server/dev/hot-reloader.js',
'/Users<path>/node_modules/next/dist/server/dev/next-dev-server.js',
'/Users/<path>/node_modules/next/dist/server/next.js',
'/Users/<path>/node_modules/next/dist/server/lib/start-server.js',
'/Users/<path>/node_modules/next/dist/cli/next-dev.js',
'/Users/<path>p/node_modules/next/dist/bin/next'
]
}
To Reproduce
Package manager: yarn dependencies:
"dependencies": {
"next": "12.0.4-canary.2",
"preact": "^10.5.13",
"preact-render-to-string": "^5.1.19",
"react": "npm:@preact/compat@^0.0.4",
"react-dom": "npm:@preact/compat@^0.0.4"
},
Upgrade next.js to version >= 12.0.4-canary.2.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:18
- Comments:14 (13 by maintainers)
Top Results From Across the Web
Error: Cannot find module - webpack-dev-server.js
I run into the same issue above. You can try the following: "scripts": { "start": "webpack-dev-server --open --hot", "build": ".
Read more >cannot find module '...' or its corresponding type declarations
I've been trying to deploy my nextjs app on Vercel, but got "Type error: cannot find module '...' or its corresponding type declarations" ......
Read more >Cannot find module 'react/package.json' #17448 - Issuehunt
Storybook build fails in CI environment with error Error: Cannot find module 'react/package.json' #17448. shamprasadrh posted onGitHub. Describe the bug.
Read more >Error: Cannot find module '@medic/contact-types-utils'
I'm trying to run “node server.js” in my cht project/api but I got error: ERROR: UNHANDLED REJECTION! ERROR: Reason: Error: Cannot find ......
Read more >cannot find module 'formik' or its corresponding type ...
import { Field } from "formik";. On my machine (Windows) it builds fine. Because of the different OS or settings, Vercel was failing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same issue. My workaround until this is fixed is installing
scheduler
withnpm install scheduler
.Hi, this has been updated in
v12.0.11-canary.7
of Next.js, please update and give it a try!