-
Notifications
You must be signed in to change notification settings - Fork 921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Windows bugs by bumping rollup-plugin-polyfill-node
to 0.7.0
#3606
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pikapkg/snowpack/G4vKSE7tDtnXD2tZTynWbqg5Ag37 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing! We’d really love to bump other Rollup deps, but we’re currently limited by bugs in the latest versions of rollup
and @rollup/plugin-commonjs
(see #2572).
AFAIK, upgrading the node polyfill plugin is safe, or at least, our test suite will prevent any known regressions from happening.
@drwpow @rpadaki This hasn't fixed the problem for me. If I upgrade my snowpack to 3.8.8, it still depends on
I'm not really a Node developer, but I think to fix this for folks someone will need to:
Is there a workaround I can use in the meantime? I tried adding
to my main package.json, and running an |
Oh! I see why I can't install 0.7.0. It's actually a major/breaking change from a |
Hey @NfNitLoop! I'm not really a node dev either, but I'm happy to help you figure out a workaround at the very least. Is there a particular repo/project I should try running? Is there a slack/discord/irc/etc where it would be convenient to chat? |
I have this issue aswell with socket.io-client 4.2.0 and Snowpack 3.8.8 |
I have the same issue aswell |
Same issue here... |
Hello @rpadaki, Looks like we just need to increment the esinstall version in |
Changes
Before, when
nodePolyfill: true
is set in the snowpack config, the files_snowpack/pkg/common/_polyfill-node:XXX.js
were not created due to:
being an illegal character in Windows filenames. This would exhibit itself as an empty_polyfill-node
file being created, and all polyfill imports failing in the application. I fixed this in PR snowpackjs/rollup-plugin-polyfill-node#24 by switching the:
to a.
After fixing this issue, I noticed that relative imports in the polyfills -- for example, anything that needed the
http-lib
polyfills, were failing on Windows. This was because we were using\\
as a path separator in JS imports. I fixed this in PR snowpackjs/rollup-plugin-polyfill-node#26 by using POSIX separators here.Those PRs were both merged and included in the new release of version
0.7.0
of https://github.com/snowpackjs/rollup-plugin-polyfill-node.This PR aims to finally:
By bumping to this release of
rollup-plugin-polyfill-node
!Testing
I've been using snowpack on Windows for the last few months by manually applying the changes I made to
rollup-plugin-polyfill-node
, without a hitch. I also made sure to run the tests included in https://github.com/snowpackjs/rollup-plugin-polyfill-node.For a more detailed testing setup:
nodePolyfill: true
in your snowpack configsnowpack build
and ensure that_snowpack/pkg/common/_polyfill-node.XXX.js
file(s) are created and are non-emptyhttp-lib
, and ensure that it actually builds without crashingDocs
Please let me know if you want me to add documentation, though I think this is just a pretty simple bugfix.