-
Notifications
You must be signed in to change notification settings - Fork 40
Failed to resolve import "vite-plugin-node-polyfills/shims/buffer" #81
Copy link
Copy link
Open
Labels
missing reproductionThis issue does not provide a reproducible example of the problem.This issue does not provide a reproducible example of the problem.
Description
When using a version higher than 0.17.0, and polyfilling a bunch of stuff (see vite config snippet below), I get the following error:

The relevant section of my vite config is this:
"plugins": [
// ...
nodePolyfills({
globals: {
Buffer: true,
global: true,
process: true,
},
include: [
'fs',
'path',
'crypto',
'stream',
'util',
'http',
'https',
],
}),
// ...
]With this config everything works fine in 0.17.0 but in the testet versions 0.19.0 and 0.21.0 the error occurs
When trying to include "buffer" in the include array, it also fails because there is no polyfill for it (or it gets already polyfilled by the globals section above).
( ERROR: [plugin: node-stdlib-browser-alias] Cannot find module 'vite-plugin-node-polyfills/shims/buffer' from '.')
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
missing reproductionThis issue does not provide a reproducible example of the problem.This issue does not provide a reproducible example of the problem.