-
Notifications
You must be signed in to change notification settings - Fork 470
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
type: module breaking webpack compilation #523
Comments
Thanks for the report. This regressed in #512 (cc @timmywil, we need to take this into account in projects that don't have separate {
"type": "commonjs"
} That should resolve your issue; I wonder if there are other breaking consequences of this change, though. |
BTW, we'd catch this if we had any Node-based or bundler tests. The Node ones are the easiest but Migrate doesn't really support Node.js. |
PR jquerygh-512 added the `"type": "module"` field to the top-level `package.json`, making Node-based workflows fail when trying to require Migrate as it's not exposed as ESM. To fix this, add a small `package.json` with just `"type": "commonjs"`. Also, add Node.js smoke tests as the simplest way to verify this change. Fixes jquerygh-523 Ref jquerygh-512
PR jquerygh-512 added the `"type": "module"` field to the top-level `package.json`, making Node-based workflows fail when trying to require Migrate as it's not exposed as ESM. To fix this, add a small `package.json` with just `"type": "commonjs"`. Also, add Node.js smoke tests as the simplest way to verify this change. Fixes jquerygh-523 Ref jquerygh-512
PR: #525 |
Your fixes come faster than my testing 😉. Adding the described |
Thanks for confirming! |
Fixed in jQuery Migrate |
Post 3.4.1, the top-level
package.json
has been changed to havetype: module
.Our host environment is ESM as well, and as such we import jquery-migrate. Unfortunately, with the type defined as module, the CommonJS/AMD wrapper is falling through to browser globals when compiled, and we don't have browser globals for anything, jquery included, and thus we're failing at runtime.
Removing
type: module
from the 3.5.0package.json
does resolve the issue.Using webpack 5.93.0, jquery 3.7.1, jquery-migrate 3.5.0. Backing off to 3.4.1 resolves the issue, as that release did not have
type:module
present.The text was updated successfully, but these errors were encountered: