react-grid-layout: Uncaught TypeError: Super expression must either be null or a function
Just leaving it here as a reference for someone else.
The following error started happening on my web app a couple hours ago:
Uncaught TypeError: Super expression must either be null or a function
The only hint was pointing to https://github.com/STRML/react-draggable.
What happened is that grid-layout@v0.17.1 depends on react-draggable@^4.0.0, which deployed v4.3.1 ~6 hours ago.
I’m not sure if react-draggable@4.3.1 is broken or not backward-compatible.
My solution was to add into my package.json:
"resolutions": {
"react-grid-layout/**/react-draggable": "4.2.0"
},
That way yarn (as per https://classic.yarnpkg.com/en/docs/selective-version-resolutions) could do the dirty work for me.
There is also npm-shrinkwrap which might be helpful if you’re not using yarn.
I’d recommend updating the depency from ^4.0.0 (minor) to 4.2.x (patch, and in a more readable form).
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 10
- Comments: 18
Thanks @igor9silva, I fixed it. @storybook/ui used react-draggable, so it caused a build error. I update package.json with resolutions:
Thank you @igor9silva . Finally, I got it worked.
For npm, we made the following changes, now it works again:
package-lock.json
package.json
It was all good until yesterday where our Verdaccio npm proxy cached a new version, so we’re trying now to implement your resolution fix, maybe it helps us, too:
Feeling the same heat 😦