davidmyersdev / vite-plugin-node-polyfills

A Vite plugin to polyfill Node's Core Modules for browser environments.
MIT License
301 stars 22 forks source link

Missing "./shims/global" specifier #69

Closed raimund-schluessler closed 9 months ago

raimund-schluessler commented 9 months ago

Hi,

when trying to build a vue3 app for Nextcloud using nextcloud-vite-config from https://github.com/nextcloud-libraries/nextcloud-vite-config/pull/18 I run into this error message when using vite-plugin-node-polyfills 0.18.0 or 0.19.0.

[commonjs--resolver] Missing "./shims/global" specifier in "vite-plugin-node-polyfills" package
error during build:
Error: Missing "./shims/global" specifier in "vite-plugin-node-polyfills" package

As far as I can tell, this did not happen with 0.17.0, so I kind of assume that this might be related to #63?

In case you need a reproduction example, let me know and I will try to put one together. Anyway, thanks a lot for the effort you put into the library!

davidmyersdev commented 9 months ago

Hey @raimund-schluessler! A reproduction would be really helpful. I tested this under some other scenarios without any issues, so something that shows me your specific use case will help me get some automated tests and a fix together for this.

llemllen commented 9 months ago

same problem

raimund-schluessler commented 9 months ago

@davidmyersdev Thanks for the help. I found the issue, and it's not on your side :slightly_smiling_face: :see_no_evil: Sorry for the hassle.

The problem was that a peer dependency relied on vite-plugin-node-polyfills@0.15.0 that conflicted with 0.19.0 from another dependency. I bumped all occurrences of vite-plugin-node-polyfills to 0.19.0 and everything works now :+1:

davidmyersdev commented 9 months ago

Ah, that makes sense. No worries at all, and thanks for following up!