Skip to content
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(webpack): use javascript/auto for js rule #9180

Merged
merged 24 commits into from May 17, 2021
Merged

fix(webpack): use javascript/auto for js rule #9180

merged 24 commits into from May 17, 2021

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Apr 22, 2021

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Webpack 4 + .mjs dependencies currently causes an issue where that package's sub-dependencies are not imported in the correct context and the following error is generated (for example):

Can't reexport the named export [...] from non EcmaScript module (only default export is available)

This PR turns off webpack 4's .mjs handling to avoid broken dependencies. I expect this will be a temporary fix whilst the ecosystem moves to native ESM. Note that there is no such issue in webpack 5.

Checklist:

  • All new and existing tests are passing.

@codecov-commenter
Copy link

codecov-commenter commented Apr 22, 2021

Codecov Report

Merging #9180 (e15f438) into dev (6d1e217) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #9180   +/-   ##
=======================================
  Coverage   65.10%   65.10%           
=======================================
  Files          94       94           
  Lines        4098     4098           
  Branches     1121     1121           
=======================================
  Hits         2668     2668           
  Misses       1152     1152           
  Partials      278      278           
Flag Coverage Δ
unittests 65.10% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/webpack/src/config/base.js 65.69% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6d1e217...e15f438. Read the comment docs.

@danielroe danielroe requested a review from pi0 April 23, 2021 11:15
@pi0
Copy link
Member

pi0 commented May 11, 2021

For supporting type: module packages, it probably makes sense to use js/auto for original babel rule (all transpiled files) (it was also needed in an attempt to migrate image runtume to modify babel rule.

danielroe and others added 23 commits May 11, 2021 15:02
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
this helps avoiding regressions like #9268. in 2.16 we probably start bundling type dependencies
* chore(deps): update all non-major dependencies

* revert @types/webpack-dev-middleware update

* renew yarn.lock (closes #9260)

* chore: ignore cve 1693

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
@pi0 pi0 mentioned this pull request May 17, 2021
@pi0 pi0 changed the title fix(webpack): add .mjs workaround to default webpack config fix(webpack): use javascript/auto for js rule May 17, 2021
@pi0 pi0 merged commit 7955553 into dev May 17, 2021
@pi0 pi0 deleted the fix/mjs-workaround branch May 17, 2021 18:55
@danielroe
Copy link
Member Author

(Note, this is not sufficient to solve this issue when using with PNP.)

@dargmuesli
Copy link
Member

Will there be a release including this change soon? :) Just wondering, I've been waiting for that since early June 🤩

@pi0
Copy link
Member

pi0 commented Aug 3, 2021

Soon @dargmuesli with 2.16 (since is a risky change). In the meantime, you can try using nuxt-edge and feedback if working :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants