Module not found. attempted require...
See original GitHub issueI get an error when using prerender-loader. It seems to fail with the below error. I traced it to this line and it appears that the only keys in compilation.assets
are ssr-bundle.js
. Any suggestions?
' Error: Child compilation failed:\n Module build failed (from ./node_modules/prerender-loader/dist/prerender-loader.js):\n Error: Error: Module not found. attempted require("url")\n \n - index.js:190 runChildCompiler.then.window.require\n [account-web]/[prerender-loader]/src/index.js:190:19\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n - Error: Error: Module not found. attempted require("url")\n \n - compiler.js:79 childCompiler.runAsChild\n [account-web]/[react-app]/[html-webpack-plugin]/lib/compiler.js:79:16\n \n - Compiler.js:296 compile\n [account-web]/[react-app]/[webpack]/lib/Compiler.js:296:11\n \n - Compiler.js:553 hooks.afterCompile.callAsync.err\n [account-web]/[react-app]/[webpack]/lib/Compiler.js:553:14\n \n \n - Hook.js:35 AsyncSeriesHook.lazyCompileHook [as _callAsync]\n [account-web]/[react-app]/[tapable]/lib/Hook.js:35:21\n \n - Compiler.js:550 compilation.seal.err\n [account-web]/[react-app]/[webpack]/lib/Compiler.js:550:30\n \n \n - Hook.js:35 AsyncSeriesHook.lazyCompileHook [as _callAsync]\n [account-web]/[react-app]/[tapable]/lib/Hook.js:35:21\n \n - Compilation.js:1294 hooks.optimizeAssets.callAsync.err\n [account-web]/[react-app]/[webpack]/lib/Compilation.js:1294:35\n \n \n - Hook.js:35 AsyncSeriesHook.lazyCompileHook [as _callAsync]\n [account-web]/[react-app]/[tapable]/lib/Hook.js:35:21\n \n - Compilation.js:1285 hooks.optimizeChunkAssets.callAsync.err\n [account-web]/[react-app]/[webpack]/lib/Compilation.js:1285:32\n \n \n - Hook.js:35 AsyncSeriesHook.lazyCompileHook [as _callAsync]\n [account-web]/[react-app]/[tapable]/lib/Hook.js:35:21\n \n - Compilation.js:1280 hooks.additionalAssets.callAsync.err\n [account-web]/[react-app]/[webpack]/lib/Compilation.js:1280:36\n \n \n' ]
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
You attempted to import /node_modules/react-refresh/runtime ...
Module not found : Error: You attempted to import .../node_modules/react-refresh/runtime.js which falls outside of the project src/ directory.
Read more >Module not found Error: You attempted to import which falls ...
I think path for your Player component is incorrect import Player from "../components/Player";. Try this: import Player from ".
Read more >module-not-found - Next.js
A module not found error can occur for many different reasons: The module you're trying to import is not installed in your dependencies;...
Read more >Troubleshoot Azure IoT Edge common errors - Microsoft Learn
Use this article to identify and resolve common issues when using IoT Edge solutions. If you need information on how to find logs...
Read more >Have a JavaScript Module Not Found Error ... - Airbrake Blog
If you're seeing a "module not found: error: can't resolve," in your Javascript code, here's an explanation as to why and how to...
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 know this is a real issue, but this plugin isn’t designed to be used in development mode (with hot-reloading libraries): you should only need to apply it on a production build (with no added code from webpack hot-reloading libraries)
Regarding conditional escaping, you can do this: