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
v4.3.1: Super expression must either be null or a function #472
Comments
Do you have a stacktrace? I am not seeing this error. |
I'm using
|
@STRML, I am getting the same error in my production build: |
Same error with react-grid-layout ~0.18.3 |
Determined it was a build server caching issues with us. |
Can you get an example of this happening in codesandbox or debug further? I cannot replicate this. |
By chance, are any of you using terser? terser/terser#308 |
We're experiencing this issue and we're using terser: We've pinned to 4.2.0 for now... |
same issue, but not using terser at our side. |
Same issue here: |
Same issue here. I forked: I then use this fork into a package built with webpack. Everything is working fine if I pin 4.2.0 or use npm start for the final application. |
I've changed "react-draggable" to "4.2.0" (without ^), it works |
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 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. |
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 |
Any chance we can do a patch that rolls back 4.3.1 version until root cause is found? |
If you are using an old version, try upgrading to the latest version.
…On Thu, Apr 30, 2020, 9:17 AM Alexander Nelson ***@***.***> 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
<#472 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNBYXOBRC5D2AHD2IBZI5TRPGJBBANCNFSM4MHAFGDQ>
.
|
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.
|
I'm also experiencing this problem now. The weird thing is that on localhost it all works good, but once i deploy to Firebase or AWS Amplify, I get this problem. You can see it here: |
So did you solve the issue? I'm also experiencing this problem only on my build server, while on localhost it's fine. |
Thanks for that, any chance you can reproduce it locally too? That minified file is very oddly formatted, my inspector can barely keep up with the execution path, and running it through a niceifier (like jsnice) completely changes the ordering of the file. It looks like Terser is getting a little too clever for its own good. |
I'll try to reproduce, although i don't have terser on my local install. so it will need some configurations. For now I also reverted to 4.2.0 which seems to work (a different link, i'll keep this broken link alive so you can use it for debugging) |
Is there any fix for it? My production build is blocked due to this issue. |
Hi there, same issue here |
Hi. We still need a reproduction for this issue if we are going to fix it. |
Looking at facebook/create-react-app#7236 (comment) , I'm not sure what the exact issue is but it sounds like if we set webpack mode to "none" and remove the optimization config then it should solve the problem. He makes a good point that the client will be minimizing anyways so this is unnecessary to include. Thoughts on this? |
@STRML this probably relates to your comment earlier referencing terser/terser#308 |
There is nothing special in the browser build that is actually practical for modern use. The "browser" field, as defined in https://github.com/defunctzombie/package-browser-field-spec#overview, indicates that you should use it if you are directly accessing globals, using browser-specific features, dom manipulation, etc. React components like react-draggable are built to do minimal raw DOM manipulation, and to always gate this behind conditionals to ensure that server-side rendering still works. We don't make any changes to any of that for the "browser" build, so it's entirely redundant. Hoping this also fixes the "Super expression must either be null or a function" error (#472) that some users have experienced with particular bundler configurations. The browser build may still be imported at "build/web/react-draggable.min.js". This is to prevent breakage only. The file is no longer minified to prevent possible [terser bugs](terser/terser#308).
I've published |
Seems fixed. We encountered the problem, when using react-rnd (which uses react-draggable) and I can confirm that your new version is working for us. Further information: As @nelsondude mentioned, the terser-webpack-plugin, that will be integrated as a build step, when running webpack in production mode had an issue and we could solve it by upgrading terser to the latest version... But your fix works even with the broken terser version. @STRML If you are still trying to reproduce the issue, I could help you. |
This is fixed in Thanks all for your patience with me, I had a hare-brained idea to modernize the builds I was shipping to support umd, cjs, and modules - an exercise in futility to handle well, with the costs far outweighing the benefits. Most of that work is deleted in |
This appears to still be an issue. Using next 13.4.1, React 18.2.0, react-grid-layout 18.2.0, react-draggable ^4.4.1 Simple app with one page file that looks as follows:
This yields:
|
For me |
Thank you so much for this! It was not working with Nextjs13 for me until adding this line. Which kind of sucks since I really wanted my project to be SSR |
when use v4.3.1, console error: Super expression must either be null or a functio...
v4.2.0 is ok
The text was updated successfully, but these errors were encountered: