Having to add `resolve` node packages to avoid polyfill?
See original GitHub issueHi,
I had to add buffer
and other node packages to resolve otherwise it was converting it to ArrayBuffer. I use node libraries in the renderer.
renderer: {
resolve() {
return [
"bw-casclib", "events", "util", "fs/promises", "stream", "buffer", "string_decoder"
]
}
},
I find my case to be strange because I believe vite no longer automatically polyfills, so I must be doing something wrong? I’m additionally getting issues around this kind of thing and I’m not certain why.
Above I will also now need to include url
and zlib
to the resolves. Is this as designed or am I doing something wrong?
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to Polyfill node core modules in webpack 5
This was resolved simply by installing the buffer package with npm install -D buffer . 'fs'. Module not found: Error: Can't resolve 'fs ......
Read more >BREAKING CHANGE: webpack < 5 used to include polyfills ...
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case.
Read more >How to polyfill node core modules in webpack 5 - Alchemy
The main issue with create-react-app and the polyfill error is that create-react-app, by default, hides the webpack config file inside the node- ...
Read more >How to Polyfill node core modules in webpack 5.
Webpack 5 is in beta and my company decided to switch to it. So I went head-on with the task at hand. Following...
Read more >if you don't want to include a polyfill, you can use an empty ...
node.js - How to Polyfill node core modules in webpack 5 - Stack . ... I had a minor fix, I was able...
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
seems like I needed the esmodule but I don’t know why. probably just for the last one
libnpmsearch
.Try a new plugin? These problems will disappear 🚀 https://github.com/electron-vite/vite-electron-plugin