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

v4.3.1: Super expression must either be null or a function

Open xiaodi0003 opened this issue 6 years ago • 35 comments

when use v4.3.1, console error: Super expression must either be null or a functio... v4.2.0 is ok

xiaodi0003 avatar Apr 13 '20 14:04 xiaodi0003

Do you have a stacktrace? I am not seeing this error.

STRML avatar Apr 13 '20 15:04 STRML

I'm using react-draggable with react-resizable. This is what I have in console

Uncaught TypeError: Super expression must either be null or a function
at react-draggable.min.js:537
at react-draggable.min.js:536
at Module.<anonymous> (react-draggable.min.js:535)
at n (react-draggable.min.js:15)
at Object.e.exports (react-draggable.min.js:88)
at n (react-draggable.min.js:15)
at e.exports (react-draggable.min.js:51)
at Object.<anonymous> (react-draggable.min.js:5)
at f ((index):1)
at Object.<anonymous> (Resizable.js:10)

andreitarasov-dev avatar Apr 13 '20 16:04 andreitarasov-dev

@STRML, I am getting the same error in my production build:

image

Jordan-Eckowitz avatar Apr 13 '20 16:04 Jordan-Eckowitz

Same error with react-grid-layout ~0.18.3

dan7554 avatar Apr 13 '20 18:04 dan7554

Determined it was a build server caching issues with us.

dan7554 avatar Apr 13 '20 19:04 dan7554

Can you get an example of this happening in codesandbox or debug further? I cannot replicate this.

STRML avatar Apr 13 '20 23:04 STRML

By chance, are any of you using terser? https://github.com/terser/terser/issues/308

STRML avatar Apr 17 '20 16:04 STRML

We're experiencing this issue and we're using terser: terser@^4.1.2 terser-webpack-plugin "^1.4.1"

We've pinned to 4.2.0 for now...

mattogren avatar Apr 18 '20 00:04 mattogren

same issue, but not using terser at our side.

dennisvankekem avatar Apr 18 '20 21:04 dennisvankekem

Same issue here: "react-grid-layout": "^0.18.3", "react-draggable": "^4.2.0", "react-resizable": "^1.10.1", Not using Terser Blocking a production build..

Zwieks avatar Apr 18 '20 22:04 Zwieks

Same issue here.

I forked: "react-grid-layout": "0.16.9" containing in the package.json: "react-draggable": "3.x" "react-resizable":"1.x" what leads to the lock of react-draggable in version 3.3.2 and 4.3.1

I then use this fork into a package built with webpack. The final application is using this package and builds correctly but I have the exact same error in the browser console at application startup.

Everything is working fine if I pin 4.2.0 or use npm start for the final application.

jelafi avatar Apr 18 '20 22:04 jelafi

Same issue here: "react-grid-layout": "^0.18.3", "react-draggable": "^4.2.0", "react-resizable": "^1.10.1", Not using Terser Blocking a production build..

I've changed "react-draggable" to "4.2.0" (without ^), it works

krotsky avatar Apr 20 '20 08:04 krotsky

Facing the same issue suddenly. Works fine in Dev env but fails on Prod. Any rootcause? because there was no change in package.json done and no change in code as well.

SmithaHS avatar Apr 23 '20 19:04 SmithaHS

Facing the same issue suddenly. Works fine in Dev env but fails on Prod. Any rootcause? because there was no change in package.json done and no change in code as well.

Check your package.json. If you have "react-draggable": "*" or "^4.2.0", you will have a new broken version automatically when running npm install.

Specify explicitly the working version like "react-draggable": "4.2.0"

andreitarasov-dev avatar Apr 24 '20 05:04 andreitarasov-dev

Facing the same issue suddenly. Works fine in Dev env but fails on Prod. Any rootcause? because there was no change in package.json done and no change in code as well.

Check your package.json. If you have "react-draggable": "*" or "^4.2.0", you will have a new broken version automatically when running npm install.

Specify explicitly the working version like "react-draggable": "4.2.0"

Yes, added it explicitly and it works fine with that. Wanted to root cause it. Have not mentioned react-draggable separately in package.json.

SmithaHS avatar Apr 24 '20 06:04 SmithaHS

Same issue here. Using terser and uglify - i think it can be fixed by setting f_names=true in terser config but this feels like a hack

nelsondude avatar Apr 29 '20 15:04 nelsondude

Same here, since an upgrade from 3.x to 4.3.1. image

Rollback to 4.2.0 resolved the issue.

Chnapy avatar Apr 30 '20 14:04 Chnapy

Any chance we can do a patch that rolls back 4.3.1 version until root cause is found?

nelsondude avatar Apr 30 '20 15:04 nelsondude

If you are using an old version, try upgrading to the latest version.

On Thu, Apr 30, 2020, 9:17 AM Alexander Nelson [email protected] wrote:

Any chance we can do a patch that rolls back 4.3.1 version until root cause is found?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/STRML/react-draggable/issues/472#issuecomment-621919997, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNBYXOBRC5D2AHD2IBZI5TRPGJBBANCNFSM4MHAFGDQ .

dan7554 avatar Apr 30 '20 18:04 dan7554

The issue is, there were zero packaging changes made between these versions. I don't know what we need to rollback.

If someone could please get a reproduction working (I have not been able to), then I can bisect and push a patch fast.

STRML avatar Apr 30 '20 18:04 STRML