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

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

Open
ok-martin opened this issue Apr 17, 2020 · 6 comments

Comments

@ok-martin
Copy link

ok-martin commented Apr 17, 2020

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]: > project@0.1.0 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 ok-martin changed the title Bug. ReactJS Uncaught TypeError: Super Expression must either be null or a function, not undefined Bug. Uncaught TypeError: Super Expression must either be null or a function Apr 17, 2020
@STRML
Copy link
Collaborator

STRML commented Apr 17, 2020

Seems to relate to react-grid-layout/react-draggable#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.

@krotsky
Copy link

krotsky commented Apr 20, 2020

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

@mrgrotts
Copy link

@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"

@pranavatoito
Copy link

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

@STRML
Copy link
Collaborator

STRML commented May 11, 2020

Will keep this open until the underlying issue is fixed. If any of you have a stable reproduction please link it here or in react-grid-layout/react-draggable#472.

@ok-martin
Copy link
Author

Can confirm that fixing it to 4.2.0 solved the issue.

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

No branches or pull requests

5 participants