Open OliverWich opened 4 months ago
Just got bit by this one on v0.21.0 @davidmyersdev this is a gnarly regression, could we get a fix in por favor?
FWIW this is due to the class node module resolution not finding anything at vite-plugin-node-polyfills/shims/buffer
because the built files exist at vite-plugin-node-polyfills/shims/buffer/dist
Similar issue here, version 0.17.0 works though.
Hello, also, I got same issue. I accepted my senior's comment. just change version to "0.17.0". And it works. Thank you bros.
Um... Something happens.
I can build with latest version. (not 0.17.0) when I add "vite-plugin-node-polyfills" at the "top-level" of monorepo.
my project status is.
before "vite", I was developing with "cra".
Because I'm amature yet, I can not pick the reason why this situation happens...
After that experience, I have some test.
I don't know why this solve the problem...
Running into this issue as well -- it occurs from within a lerna repo and a common package is referencing Buffer (but not using vite).
Hello, also, I got same issue. I accepted my senior's comment. just change version to "0.17.0". And it works. Thank you bros.
This
Changing the version to 0.17.0 helps me as well. Thank you @raduciobanu22 🙏
I wasn't able to reproduce this error with just the config provided above. I'll need a StackBlitz or CodeSandbox example in order to diagnose the issue and get a fix together.
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:![image](https://github.com/davidmyersdev/vite-plugin-node-polyfills/assets/35409274/d9881d1e-b4f8-4b4e-9373-8e56a4782645)
The relevant section of my vite config is this:
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 '.'
)Upvote & Fund