Error: cannot find module undefinedbuild/... after HMR
See original GitHub issuePreflight Checklist
- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project follows, as appropriate.
- I have searched the issue tracker for a bug that matches the one I want to file, without success.
Issue Details
Durig development after hot reloading the app, the following error occurs:
Uncaught Error: Cannot find module 'undefinedbuild/Release/better_sqlite3.node'
Require stack:
- electron/js2c/renderer_init
at Module._resolveFilename (internal/modules/cjs/loader.js:887)
at Function.o._resolveFilename (electron/js2c/renderer_init.js:33)
at Module._load (internal/modules/cjs/loader.js:732)
at Function.f._load (electron/js2c/asar_bundle.js:5)
at Function.o._load (electron/js2c/renderer_init.js:33)
at Module.require (internal/modules/cjs/loader.js:959)
at require (internal/modules/cjs/helpers.js:88)
at eval (database.js?4c26:9)
at Object../node_modules/better-sqlite3/lib/database.js (index.js:66025)
at __webpack_require__ (index.js:78100)
better_sqlite3 is a native module and is built with electron-rebuild during install with a script in package.json:
"postinstall": "electron-rebuild -f -w better-sqlite3",
For HMR I’m using react-hot-loader
.
- Electron Forge Version:
- 6.0.0-beta.59
- Electron Version:
- 13.1.7
- Operating System:
- Windows 10
- Ubuntu 12.04 x64
- Last Known Working Electron Forge version::
- 6.0.0-beta.57
Expected Behavior
The app should reload correctly.
Actual Behavior
The error appears in the console and the screen keeps blank.
To Reproduce
Additional Information
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Error: cannot find module undefinedbuild/... after HMR #2412
Issue Details. Durig development after hot reloading the app, the following error occurs: Uncaught Error: Cannot find module 'undefinedbuild/ ...
Read more >electron-forge package Error: Cannot find module
I am trying to run the packaged electron app on my local Mac. But get an error message saying Error: Cannot find module...
Read more >Import.meta.env undefined on production build vitejs-Reactjs
Nextjs fails to find valid build in the '.next' directory in production ... Syntax error: Cannot read property 'map' of undefined (0:undefined) build...
Read more >r/nextjs - Reddit
NextJS throws random "Error: Cannot find module './undefined'". I just encountered this error while navigating to different links using NextJs's ...
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
with this webpack.plugins.js it works!
Nevermind, just missed to configure the path correctly. For anyone else