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
Upgrade Rollup to 0.68.1+ #17352
Comments
|
Is there anything actionable for React here? It seems like this was a Babel problem that is now fixed. |
The action item for React here is to upgrade to the new version of Babel so React can be used in ES modules. Basically, change the version number on these lines to 7.7.0 or higher and then |
Seems like we can remove the "needs info" label. Sounds like the fix is to make sure |
@MicahZoltu Any interest in picking this up and submitting a PR? :) |
@bvaughn PR created, though it has some errors that I don't understand. |
Turns out, the issue is actually with an old version of rollup, not babel. Rollup fixed the bug back in December 2018 with rollup/rollup#2594 (though, that contained a bug that was then rectified in rollup/rollup#2600). I believe the fix for this is included in all versions of Rollup after 0.68.1, so to resolve this issue React needs to upgrade its Rollup version to 0.68.1. I tried to update to 0.68.1 but ran into issues, so I think someone more familiar with the React build process will need to take a look at this. Note: Rollup is now up to version 1+, it may be worth upgrading all the way to 1 (stable release) if someone is going to take the time to bump the rollup version. I have updated the original issue title/description with this new information. |
Thanks for the update! Unfortunately, upgrading certain dependencies (Rollup, Flow) are a little trickier than others. Not sure when we'll get to them, but it is something we discuss from time to time as something we want to get to. |
This issue is outdated and should be closed. As the current rollup in react is already 1.0+ and the highest available is 2.0+ a new issue would be more appropriate. |
Good call. React is already using Rollup 1.31.1. |
Do you want to request a feature or report a bug?
Bug-ish.
What is the current behavior?
import 'react'
(where 'react' is the UMD module build) from an ES module will fail due to rollup/rollup#2274.this
is not set in the context of ES modules, so if you try toimport 'react'
in that context you will get a runtime error sincethis
is undefined and Rollup (before the linked fix) tries to usethis
when it really meansglobalThis
orself
.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:
index.html
What is the expected behavior?
The React UMD module can be loaded by an ES module.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React: 16.11.0
Firefox: 70.0.1
Windows 10
The text was updated successfully, but these errors were encountered: