-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat(nextjs): Add support for Next.js 13 app router #385
Conversation
mayank1513
commented
Jul 29, 2023
•
edited by lforst
Loading
edited by lforst
- fixes Next.js 13 app router + @sentry/wizard breaks typing #307 and Wizard doesn't work with Next.js app dir because it tries to place file in pages folder #241
- checks for appRouter as well
- defaults to creating a pages folder if neither page nor app router is detected
Also fixes #241 |
Hey, thanks for this PR. We are very likely gonna merge it but I will hold off for a bit because I am planning on adding API routes support very soon and then we can drop the special casing. |
Thanks. Can I help in adding support for route handlers? |
Yes of course. PRs are always welcome! |
Just to add to this, I spent a number of hours trying to debug why my middleware suddenly stopped working when installing Sentry using the wizard. I eventually tracked it down to the addition of a pages folder on my root. As I am using a src/ directory for my app folder, middleware, etc. this caused the middleware to not be run. A possible solution might be add a step that asks the user if they are using a src folder, or perhaps check the location of the existing app directory. Not sure if it's relevant, but my app did not have a pages directory before it was added by Sentry since we are using the app router for everything. |
This is taken care of in this PR. |
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Hi, I think we have waited enough for updates to sentry core functionality -> out of box support for app directory route handlers. I think we shouldn't block this PR for that. This would be against agile principles. |
@mayank1513 We will still go with the plan and merge this when route handlers are working. Last week most of Sentry was in a hackathon and we didn't operate as usual so things should speed up again now. |
Co-authored-by: Mayank <mayank.srmu@gmail.com>