-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Can't resolve 'react/jsx-runtime' in xxx/node_modules/@sentry/react/esm #12608
Comments
Hi, would you mind sharing a small reproduction example we could clone to check this error out? It is usually quite hard to troubleshoot build errors without having access to the bigger picture because there is usually so much configuration involved. Thanks! |
Getting same error on @sentry/[email protected] and on @sentry/[email protected] when I tried last week. With [email protected]. Node v20.6.1
The error seems to be referring to |
We have been having this issue in @sentry/react in every version since version 8.5.0 |
Hi @webdevian and @baw! It would be amazing if you could share a small reproduction example where this is happening. |
+1 for @baw, it's hard to set up a minimal reproduction though. It looks like it might be related with us using React 17 and React Router 6, but I'm not 100% sure. |
We've seen this in one app when it was running React 16 and it continues after it was upgraded to React 17. I don't think it's a React issue. I only see this in one of our apps and we have other apps running the latest version of @sentry/react without any issues. I'd rather spend the time fixing the issue in our app and then get back to you than make a small reproduction example. |
Due to the variety of permutations of how you can set up a react app, we really need a reproduction to dive into this. Even just sharing your bundler config and showing how you are importing Sentry would be a great help! |
Our peer deps state we only support
Could you upgrade your react version to |
I've got the same error message while trying to build an application with |
@marcosdiasdev I would like to reiterate, this issue needs reproduction. To look into this further, we need a way to reproduce this error. Please provide a stackblitz or github repo, or something similar. Thanks! |
@lforst here you go: https://github.com/pieterbeulque/getsentry-sentry-javascript-12608/commits/main/ Run Given the error I assume it's a combination of Webpack + Babel + React 17 + whatever changes you made going from 8.4 to 8.5. ( |
@pieterbeulque awesome thanks! I'll take a look. |
That was fast, thanks @lforst. |
Still running into the same issue with 8.14 (vitest). Looking at the source code, it doesn't look like the fix had any actual effect on the resulting code since I still see the incorrect import being used. |
I have encountered such an issue several times with other packages. Upgrading to react@18 should fix the issue. Also configuring a bundler alias can fix the issue. Also not using esm can fix the issue. But I have found no way to fix the issue on package side (like |
@lforst - As mentioned above, looks like the fix doesn't actually fix it. Updated the reproduction repo. |
Update: We're gonna move back to the classic runtime because we discovered issues with a non-faulty fix. The "fix" we merged actually did nothing because I made a mistake while testing. This will cause warnings in React 19, maybe we can find a way to provide a separate package or submodule exports for the new runtime when React 19 ships stably. |
thanks for the fast fix & release guys, works now 🎉 |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/react
SDK Version
8.5.0
Framework Version
React: 17.0.2
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
1、update sentry sdk version
yarn upgrade @sentry/[email protected] @sentry/[email protected]
2、run project in local
yarn start
Expected Result
The project run with no error as shown below :
![image](https://private-user-images.githubusercontent.com/95202481/342216252-fce685e6-a085-4b15-8fd8-d0654e417ca5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwODMwMDgsIm5iZiI6MTczOTA4MjcwOCwicGF0aCI6Ii85NTIwMjQ4MS8zNDIyMTYyNTItZmNlNjg1ZTYtYTA4NS00YjE1LThmZDgtZDA2NTRlNDE3Y2E1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDA2MzE0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJjMzExOTdlNTEwNDI4NjRhZjMxZjY5ODQ3YTQ1MjRlODE2NWVkZTlhMWIwMTE0ZGUyYTE0ZTdlOGFjNWJiOTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.lsHIAVbbi5lIJpUQS9T-aapDJG2-rls3AtEOQ7jyzaU)
Actual Result
The text was updated successfully, but these errors were encountered: