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

updated @babel/runtime to ^7.12.0 to resolve runtime file extensions issue in webpack 5 #1513

Merged
merged 1 commit into from Oct 15, 2020

Conversation

mwmcode
Copy link
Contributor

@mwmcode mwmcode commented Oct 15, 2020

Hello,

@babel/runtime was not specifying file extensions (discussed originally here and recently here) which wasn't a problem until webpack 5, which was released this week, started enforcing file extensions "where the package.json contains '"type": "module"'" as you can see in the error snippet below

This PR addresses this error (below).

ERROR in ./node_modules/i18next/node_modules/@babel/runtime/helpers/esm/inherits.js 1:0-46
Module not found: Error: Can't resolve './setPrototypeOf' in '/Users/mustafa/code/un/foodloss-portal/node_modules/i18next/node_modules/@babel/runtime/helpers/esm'
Did you mean 'setPrototypeOf.js'?
BREAKING CHANGE: The request './setPrototypeOf' failed to resolve only because it was resolved as fully specified
(probably because the origin is a '*.mjs' file or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/i18next/dist/esm/i18next.js 8:0-60 285:2-11 462:2-11 1451:2-11 1765:2-11
 @ ./src/shared/services/i18n.ts
 @ ./src/app/index.tsx 13:0-31

Checklist

  • [x ] only relevant code is changed (make a diff before you submit the PR)
  • [x ] run tests npm run test
  • [n/a ] tests are included
  • [ n/a] documentation is changed or added

@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.982% when pulling f5f1534 on mustafawm:master into cb780ad on i18next:master.

@jamuhl jamuhl self-requested a review October 15, 2020 07:21
@adrai adrai merged commit 5d808cd into i18next:master Oct 15, 2020
@adrai
Copy link
Member

adrai commented Oct 15, 2020

@mustafawm is an immediate release necessary for you? As the dependency was ^ it may not be necessary, right?

@mwmcode
Copy link
Contributor Author

mwmcode commented Oct 15, 2020

As the dependency was ^ it may not be necessary, right?

Hi @adrai I don't get this, can you explain why a ^ would mean that?

Personally, I've been testing webpack 5 since before its RC releases and the way I got around this error is by modifying node_modules/i18next/node_modules/@babel/runtimes and using patch-package to apply those changes postinstall

I'm happy to keep using my workaround. I think this will be needed once webpack 5 is adopted more

@adrai
Copy link
Member

adrai commented Oct 15, 2020

can you explain why a ^ would mean that?

Because of this:
image

But regardless of that, I just wanted to know whether you urgently need a new i18next version now, or whether we can still wait with publishing a new version?

@mwmcode
Copy link
Contributor Author

mwmcode commented Oct 15, 2020

Thanks mate. I can wait.

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

Successfully merging this pull request may close these issues.

None yet

4 participants