Repository navigation
Closed
Description
Note: You can already start using the Sentry Next.js SDK with Next.js 13 and the app directory. We add more features/fixes as time goes on.
For ideas, questions and discussions go here: #7999
What?
Relates to: #6290
We would like to provide first-class support for the Next.js 13 app directory.
How?
The following things need to be done to support the app directory, ordered by priority:
- [x] ~Check the Status Quo and eliminate blockers that prevent people from installing Sentry + `app` dir *today*(https://github.com/getsentry/sentry-javascript/issues/6290)~ From testing a bit nothing seems to block people from installing Sentry + the `app` dir. The SDK simply doesn't report errors (as of v7.31.0).
- [x] Inject `Sentry.init()` into the `app` dir browser bundle (https://github.com/getsentry/sentry-javascript/pull/6812)
- [x] Inject `Sentry.init()` into the `app` dir server bundle (https://github.com/getsentry/sentry-javascript/pull/6927)
- [x] Auto-wrap server components to track errors (https://github.com/getsentry/sentry-javascript/pull/6953)
- [ ] https://github.com/getsentry/sentry-javascript/issues/7176
- [ ] https://github.com/getsentry/sentry-javascript/issues/7179
- [ ] https://github.com/getsentry/sentry-javascript/issues/7641
- [ ] https://github.com/getsentry/sentry-javascript/pull/7648
- [ ] https://github.com/getsentry/sentry-javascript/issues/7228
- [ ] https://github.com/getsentry/sentry-javascript/issues/7180
- [x] Update wizard to work OOTB with app dir
- [x] Performance tracking for server components on edge
- [ ] https://github.com/getsentry/sentry-javascript/issues/9458
- [ ] https://github.com/getsentry/sentry-javascript/issues/9568
- [ ] https://github.com/getsentry/sentry-javascript/issues/7181
- [ ] https://github.com/getsentry/sentry-javascript/issues/9570
Reacted by Dale L. Jefferson, Murilo Pereira, Lawrence Jones, Oleksandr (Sasha) Khivrych, Jack Ketcham, Saif Bechan, Anand Chowdhary, Chris Lott, Guillaume Gelin, mrpatrickpilch and 35 more
Reacted by Alexander Kachkaev, Gabor Ottlik, Imamuzzaki Abu Salam, Martin Šťovíček, Zino Hofmann, Justin Fan, Louis, Michal Landsman, Hong Shik Kim (Branden), chien vu hoang and 1 more
Reacted by Tim Fish, Dale L. Jefferson, Kolby Sisk, kpujjigit, Sander Vispoel, Oleksandr (Sasha) Khivrych, Jack Ketcham, David Meents, Saif Bechan, JongWoo Ha and 28 more
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsNo status
Activity
mpereira commentedon Jan 22, 2023
Are there any hacks that folks working with Next.js 13 "app directory"-based applications could use in the meantime?
I tried something similar to what @fernandops26 reported in this issue, in addition to having a client component in
app/layout.jsthat configured Sentry. That seems to work in development, but not in applications deployed to Vercel.lawrencejones commentedon Jan 23, 2023
Leaving a note to say we're super happy to test this out on our app, if you wanted someone to test-run any docs/feature-branches before you release it more widely!
lforst commentedon Jan 23, 2023
@mpereira The newest version of the SDK will track errors that happen on the client-side. The server-side is in progress but still needs some work. I haven't really experimented with a hack for the server-side but I think you can just call Sentry.init somewhere in a server component and it should start tracking errors that happen (haven't even tried that though).
lforst commentedon Jan 23, 2023
@lawrencejones We will happily take you up on that! Thanks! It's usually the biggest challenge to consider all the edge cases people have in their apps when pushing updates to the Next.js SDK which is admittedly quite deep reaching.
We're planning on releasing server-side support soon. We can publish an alpha version for that and could ping you to try it out if that works for you.
lawrencejones commentedon Jan 23, 2023
Just seen your replies: this all sounds great, very keen on the alpha!
Since my last message I'd noticed a new patch version including the client side changes and upgraded our app to use them. I'm seen errors and traces reported to Sentry from the client, so looks like you've nailed that part (not seeing them from our production Vercel deployment but I think that's a config issue on our side).
Just let me know when you have something ready and I'll get right on it.
switz commentedon Jan 23, 2023
I'm seeing client side errors on my self hosted next.js deployment (not vercel). Thanks for the update!
switz commentedon Jan 24, 2023
I'm seeing this error actually, since pulling in the latest version: #5667
Anyone know of a fix?
edit: I should add, I'm seeing it on the client, in the browser console. On both dev and prod.
84 remaining items
Syammed2429 commentedon Sep 19, 2023
nghiepdev commentedon Sep 26, 2023
It appears that
@sentry/nextjs@7.71.0is causing a warning:"Critical dependency: require function is used in a way in which dependencies cannot be statically extracted".AbhiPrasad commentedon Sep 26, 2023
Hey @nghiepdev, could you open a GitHub issue and fill out the template so we can start to investigate? Your next config + Next.js version is the biggest things we need to help here. Is this just a warning, or does it block builds as well? Do you notice anything about runtime with it? Thanks!
chrislgrigg commentedon Sep 26, 2023
@AbhiPrasad I'm seeing the same as @nghiepdev. Opened an issue here since it's been a while and I don't think another issue was opened: #9120
[-]Next.js 13 `app` directory support roadmap[/-][+]Next.js App Router support roadmap[/+]lforst commentedon Dec 18, 2023
For the most part, the Next.js App Router is now fully supported. Thanks for your continuous feedback and support in trying out new features!
There are still a few upstream shortcomings that we need to iron out with Meta and Vercel, namely:
Moving forward, if you spot any gaps in instrumentation, please let us know here, or feel free to open a new issue in this repository. Thanks!