-
Notifications
You must be signed in to change notification settings - Fork 799
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
Uncaught TypeError: reactLifecyclesCompat.polyfill is not a function #951
Comments
Not reproducible. |
The client project I am on observed the same error described above starting last week, which led to us needing to downgrade the hot-reloader version. |
@theKashey If you install RHL in a demo app, using npm, and look at line 1440 in |
So |
Tested on fresh install - everything works. Could you double check "what" is reactLifecyclesCompat for you? |
Sure, |
@oraricha - that is only possible if you are using reactLifecyclesCompat v1. |
In my case there is conflict with [email protected] that use reactLifecyclesCompat v1. |
But it is listed in |
Honestly, I do not know. From what I can see my deps tree look this:
I think that it might be a bug in webpack or misconfiguration on my side. I use webpack 4.6.0 with mostly standard settings. |
That is a correct behaviour. And it should work without issues. |
Clearing |
@max-mykhailenko did that, didnt work. still getting the error:
|
I can confirm that changing I have react-lifecycles-compat@v1 installed in my root node_modules and v3 installed in react-hot-loader/node_modules. So if the problem is that v1 is used instead of v3, then it appears this is a bug in webpack, right? I'm using [email protected] right now. |
As long people continues complaining about this, and the code itself is correct - I have to make a tought decision and solve it with a hack. |
react-lifecycles-compat fixes, related to #951
Should be double fixed. |
If you are reporting a bug or having an issue setting up React Hot Loader, please fill in below. For feature requests, feel free to remove this template entirely.
Description
What you are reporting:
While upgrading to react-hot-loader 4.1.2, I get the following runtime error in the browser console:
Uncaught TypeError: reactLifecyclesCompat.polyfill is not a function
When I look into the dist code in my
node-modules
folder, I see the following line failing:reactLifecyclesCompat.polyfill(AppContainer);
, line 1440 inreact-hot-loader.development.js
.The original source code is here: https://github.com/gaearon/react-hot-loader/blob/948138ace84d08c95f29870b1e461154f1208cc7/src/AppContainer.dev.js#L66
It seems the code is not transpiled into ES5.1 correctly. Correct me if I'm wrong.
If I change line 1440 in the dist version to
reactLifecyclesCompat(AppContainer);
everything runs as expected and my app works again.Expected behavior
The code should run out of the box with no errors.
Actual behavior
The code fails to run since the function
polyfill
doesn't exist in reactLifecyclesCompat, but is exported as that module itself, as seen here in the source code: https://github.com/reactjs/react-lifecycles-compat/blob/e4e21a682361c6d580508fb5cfd33d265bb800cf/index.js#L47Environment
React Hot Loader version: 4.1.2
Run these commands in the project folder and fill in their results:
node -v
: v8.9.4npm -v
: 5.6.0Then, specify:
Thanks
The text was updated successfully, but these errors were encountered: