-
-
Notifications
You must be signed in to change notification settings - Fork 530
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] Client-side error (".jsx is not a function") in production (minified) NextJS app #972
Comments
Do you mind creating a sample project to help us debug the issue? Just a simple NextJS project with the tooltip. For now, please try v5.8.3 and see if it still happens. |
@gabrieljablonski Same issue on v5.8.3 as well |
I fixed version "react-tooltip": "^5.8.3" to "react-tooltip": "5.8.3". |
Hi guys, can someone create a sample project with this issue, please? We will take a look as soon as possible when someone provides a sample project. Thanks! |
Same here downgrade to 5.8.3 fixed the pb |
I have the same issue. If I set swcMinify: false in next.config.js, the error goes away. Changing from "react-tooltip": "^5.7.4", to "react-tooltip": "5.8.3", also resolves it. |
@gabrieljablonski and @danielbarion Sorry about the delay, here ya go: https://github.com/thomasmost/react-tooltip-repro Reproduced with the latest version (5.10) Steps to repro:
Thank you! |
@thomasmost Thanks for taking the time. As @devilsgeographer mentioned, you can set We'll be investigating why this is happening, but it seems to be an issue with the interaction between the default NextJS 13 minifier and our own bundling/minification process. The issue will stay open until we figure it out. |
@gabrieljablonski Glad to help! And no problem at all, as others have also mentioned, 5.8.3 doesn't seem to have this behavior. So I think I'm set for the time being 🙂 |
Thanks a lot @thomasmost - you're a lifesaver |
Hi, can you try this beta version and let me know if it worked, please?
|
@thomasmost thanks for the example repository, testest on it and it's working, please test and let me know |
@danielbarion Working in my sample repo! Gonna try it in my main project as well |
Working in my deployed app as well! |
After some researches, it seems to be caused by the SWC minifier, enabled by default on next 13 onwards The SWC compiler had quite a lot of issues that looks a lot like the one you pointed out. See for example vercel/next.js#40601. I've tried Since other bundlers work without any problem, I have the feeling that this is a bug of |
That being the case, what was changed in I can also link this issue with one in the NextJS GitHub... |
@thomasmost not sure because we do not track beta releases, they are just for testing possible solutions purpose, also we have 2 PRs opened, one of them we started with the |
not sure what was the exact change, but maybe this helps tracking it down |
ohh, nice @gabrieljablonski @thomasmost probably the first commit is related to the version that you want know the changes: 86549ee |
I can confirm that |
Hi guys, we are still working on this, please check open PRs and let us know wich works 100% for you! Thanks |
Unfortunately, I am not finding a beta that works 100%.
|
I'll take a look as soon as possible at what we changed for beta 4, thanks for letting us know ps: I'll probably have time to handle this more carefully next week |
must use v5.8.3; migth be fixed in v5.10.1 see: ReactTooltip/react-tooltip#972
guys, just a heads up, please check this comment: #984 (comment) |
|
Downgrading because of bug: ReactTooltip/react-tooltip#972
The latest version ( |
@pohy @everyone please try this one: #984 (comment) (the next release candidate) and let us know. I tested this PR using Next.js 13 + experimental APP folder and SWC enabled and worked. |
I can confirm I'm running |
@AllanOliveiraM can you provide an example so I can test it, please? Thanks for confirming @thathurtabit! |
@thomasmost just tested your example and upgrading to Next.js |
@danielbarion |
As mentioned above (#972 (comment)), I personally highly suspect a bug in SWC minifier. All beta release you've seen mentioned are tries to limit occurrence of this suspected bug. I cannot strictly affirm it is a bug in Sorry for the back & forth. |
Well thanks a lot for the help |
I'd say we can technically consider #984 a fix for this issue. In case Next.js takes too long to promote this new version to stable, we might consider adding a troubleshoot section to the docs/readme so people aren't left on the dark about this. |
Describe the bug
We are using NextJS. We have used react-tooltip v4 with no problem. We have wrapped it with the mounting effect to avoid SSR errors. When we update to v5, we get an application (client-side) error in production that reads
a.jsx
is not a function. The library functions fine in development.Version of Package
v5.9.1
To Reproduce
deploy a production build of a NextJS app using a tooltip of this version—navigate to the page. Note that this is a run-time application error, not a build error.
Expected behavior
It should not crash the application
Screenshots
Desktop (please complete the following information if possible or delete this section):
Additional context
We are also using a turbo-repo, though I don't expect that's the issue
The text was updated successfully, but these errors were encountered: