-
-
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
Sentry doesn't work on Next 13.5 #9092
Comments
Can you try deleting your .next folder and re-building? Thanks! |
Hi, thanks for answering so quickly! I already tried deleting the And the
|
We are experiencing the same issues after bumping to 13.5. related change: typehero/typehero@09ae9b7#diff-197cd8ca285a4abd2f21479e0bf6e36e90b08528fcd7f3bdbe8d1221897e377d |
@bautistaaa two things:
To me, something feels off. I cannot reproduce this yet we have a few reports of this. Our E2E tests also don't run into this issue. I have a feeling that the people running into this have some sort of dirty state that the SDK doesn't particularily like (i.e. a state where |
I have the issue on localhost. Here is what the command
I ran |
@RilDev Thanks so much for running the command. This more or less confirms my suspicion. It seems that there is a global installation of Next.js on a version pre-13.5 that makes our call to I opened a PR that will likely fix this: #9100 |
Dunno if this is fixed yet |
Hi again @lforst, I checked and although there is no new release yet, I tried to run the install wizard again, just in case. It still isn't working for me. |
@RilDev We just released version |
Just curious. When can we expect the new release to be out? Thanks! |
@FaresKi good point. I'll try to cut a release today. |
@lforst i am still seeing the issue. do you see anything missing here? |
We've released changes in https://github.com/getsentry/sentry-javascript/releases/tag/7.73.0 to fix the |
Thanks a lot @AbhiPrasad and @lforst !! |
So I both upgraded Next.js to 13.5.4, and sentry upgraded to 7.73.
|
I am also seeing the same issue as @FaresKi . Fwiw the message is coming from Here's the stack:
|
Ah ok @lforst I think this is what's up:
For some reason when I add
which doesn't immediately make sense to me. Anyway, still digging. |
Here's the summary of the problem as I see it:
Anyway, hope this helps identify and fix the root problem. Tagging @FaresKi again since this ticket is still closed and might not be getting direct attention. |
@rsolomon I currently think none of this matters. Next.js has plugins configured under the hood to be able to import CJS/ESM and any combination thereof. Did you upgrade to The latter is an issue in certain setups where the traditional node resolution algorithm wouldn't find the Next.js internal module. But it is not breaking builds so we can take our time figuring this out. |
Yes, this. v7.73.0 did indeed fix the build error, so these notes are specific to the inaccessible
Yep, that's what the notes in the previous comment refer to. The aforementioned "Next.js ... plugins configured under the hood to be able to import CJS/ESM and any combination thereof" is not applicable to modules imported within the
True, but is Sentry fully functional in the scenario where |
@rsolomon Ok, it is possible that the package does not fully conform to esm, however, I still don't see how that relates to the SDK not being able to locate Btw, if you have suggestions on how to make the package esm compatible without breaking existing cjs setups, PRs are super welcome! |
My hunch was that it had something to do with both the It looks like the problem actually stems from a missing reference to root monorepo In my project (using Yarn Workspaces), and I assume any other monorepo with default
Sentry has some logic that turns (1) into There's probably a better way to accomplish this, but adding the following to my project's webpack config in
|
@FaresKi If your project is a monorepo or uses otherwise an atypical structure for node_modules, the above will probably fix this issue for you. |
@rsolomon That is exactly what I am suspecting too, as per this comment. The thing is, we are already using As for
This is not entirely correct. The resolution algorithm will look upwards in the folder tree, layer for layer, checking each |
The logic you're talking about happens before and is therefore counteracted by this check. In other words, that line's intent (based on the comment) seems to be to filter out global node_modules locations, but it instead filters any node_modules location above the outermost location defined in |
@rsolomon Oh you're absolutely right! Thanks for putting so much thought into this! <3 I'll try to find the time to find a solution here this week! |
Happy to help 😄 |
Thanks @lforst ! I'm at a conference all week but I'll do my best to check it out tonight or tomorrow night at the latest. |
Hi everybody, we just released version |
Still seeing this on |
@jamespsterling Hi, can you please open a new issue with reproduction steps? Thanks! |
Hi, I temporarily resolved the issue by downgrading Next.js to version 13.3.4 from 13.4.1. The Sentry SDK versions I am using are: "@sentry/nextjs": "^7.80.1", I'm unsure if this is related to Next.js or Sentry, as Next.js version 13.4.1 was working fine for me before integrating Sentry. I hope this information helps anyone facing a similar problem. Thanks! |
I had the same issue in a pnpm workspace, i fixed it by installing |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.70.0
Framework Version
Next 13.5.2
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
yarn add next@latest react@latest react-dom@latest eslint-config-next@latest
npx @sentry/wizard@latest -i nextjs
yarn dev
Expected Result
When navigating to
localhost:3000
, it displays a page.Actual Result
When navigating to
localhost:3000
, it throws an error:I check in my
node_modules
directory and indeedrequest-async-storage
is missing.The text was updated successfully, but these errors were encountered: