-
-
Notifications
You must be signed in to change notification settings - Fork 590
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
commonjs: v19.0.0 breaks semver
package
#879
Comments
Ok, so here is what is going on: The problem is that even with Rollup 18, the execution order of the bundle is wrong for the those two files. When you run without bundling, This only manifests as an error in version 19 because this version now "snapshots" require expressions instead of treating them as hoisted variables. Though snapshotting is technically more correct in many cases, it no longer "fixes" the broken execution order for you. Unfortunately, it is not really easy (and questionable) to "reintroduce" this. There is a really simple fix for you: Do not use assignments to const range = require('./range');
//... now access it as range.Range This will not fix the execution order but since you are not overwriting I hope that Rollup will eventually also be able to handle the correct execution order in your case, but it will be complicated and costly as basically all files will be needed to be wrapped in additional function wrappers that are conditionally executed in the correct order. |
Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it. ⓘ |
Pin the package back a ways to avoid cyclical dependencies. See rollup/plugins#879
Pin the package back a ways to avoid cyclical dependencies. See rollup/plugins#879
Expected Behavior
This code prints
true
if executed with and without bundling.Actual Behavior
After bundling it prints
false
.semver.satisfies
always returnsfalse
now.Additional Information
It worked as expected with the previous version of the plugin.
Related: #658, https://github.com/npm/node-semver/blob/master/classes/range.js
The text was updated successfully, but these errors were encountered: