react-resizable icon indicating copy to clipboard operation
react-resizable copied to clipboard

Bug. Uncaught TypeError: Super Expression must either be null or a function

Open ok-martin opened this issue 4 years ago • 6 comments

Hey,

Problem Report

The package works great when running the development build on React. It also builds correctly when I need to deploy it:

2020-04-17T03:23:54.937Z [INFO]: # Executing command: npm run build 2020-04-17T03:23:55.109Z [INFO]: > [email protected] build /codebuild/output/src994697614/src/project-react > react-scripts build 2020-04-17T03:23:56.114Z [INFO]: Creating an optimized production build... 2020-04-17T03:24:56.451Z [INFO]: Compiled with warnings.

However, when I open the production built I get the following:

Uncaught TypeError: Super expression must either be null or a function

Which breaks my entire app.

I was able to narrow down issue to react-resizable - if I take out the package and build, everything works fine.

This link provides more insight:

https://stackoverflow.com/questions/30116430/reactjs-giving-error-uncaught-typeerror-super-expression-must-either-be-null-or

System Info

"node-sass": "^4.13.1", "react": "^16.13.1" "react-scripts": "2.1.5", "react-resizable": "^1.10.1",

Reproduction

I have just started using the package and I have not done anything unusual: https://codesandbox.io/s/react-resizable-playground-kvt8i?file=/src/index.js

ok-martin avatar Apr 17 '20 03:04 ok-martin

Seems to relate to https://github.com/STRML/react-draggable/issues/472. Unknown cause at the moment. Biggest change between draggable 4.3.1 and 4.2.0 would be a devDependency upgrade. Could be causing the compile to behave differently in production mode. For now, pin react-draggable to 4.2.0.

STRML avatar Apr 17 '20 16:04 STRML

Try to fixate "react-draggable": "4.2.0" in your package

krotsky avatar Apr 20 '20 08:04 krotsky

@STRML , have you tried pinning react-draggable to 4.2.0 as a dependency in react-resizable?

This package installs react-draggable 4.0.3, but I can see in my app's lock file that this dependency is resolving to react-draggable 4.3.1.

Here's the entry from our yarn.lock file for reference, after pinning react-draggable 4.2.0 and deleting node_modules and the previous yarn.lock:

react-draggable@^4.0.3:
  version "4.3.1"
  resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-4.3.1.tgz#f9c0cdcf2279ec5b79c65b70cdfd9361d82fa9ee"
  integrity sha512-m8QeV+eIi7LhD5mXoLqDzLbokc6Ncwa0T34fF6uJzWSs4vc4fdZI/XGqHYoEn91T8S6qO+BSXslONh7Jz9VPQQ==
  dependencies:
    classnames "^2.2.5"
    prop-types "^15.6.0"

mrgrotts avatar Apr 29 '20 02:04 mrgrotts

same issue for me too. resolved the issue based on @STRML comment above.

pranavatoito avatar Apr 29 '20 11:04 pranavatoito

Will keep this open until the underlying issue is fixed. If any of you have a stable reproduction please link it here or in https://github.com/STRML/react-draggable/issues/472.

STRML avatar May 11 '20 17:05 STRML

Can confirm that fixing it to 4.2.0 solved the issue.

ok-martin avatar May 15 '20 07:05 ok-martin