-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
[NEXT-588] fetch to App Route + router.refresh() causes crash #45956
Comments
the bug occurred here:
|
Cc @huozhi |
This still occurs on StackBlitz demo: https://stackblitz.com/edit/vercel-next-js-vyumbh?file=app%2Fpage.tsx |
Seems like other users are also experiencing this: |
This still occurs on StackBlitz demo: https://stackblitz.com/edit/vercel-next-js-wzdzon?file=app%2Fpage.tsx |
This ensures there is no client component entry created for route.js. @shuding is going to investigate further why this would break the manifest generation in development. Fixes #45956 Fixes NEXT-588 <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: --> ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
This ensures there is no client component entry created for route.js. @shuding is going to investigate further why this would break the manifest generation in development. Fixes vercel#45956 Fixes NEXT-588 <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: --> ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
Great, just confirmed that #46102 works! (released in StackBlitz demo: https://stackblitz.com/edit/vercel-next-js-r58uun?file=app%2Fpage.tsx,app%2Flayout.tsx |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-mg1bxt?file=app%2Fpage.tsx,app%2Flayout.tsx
To Reproduce
The reproduction example contains a single button that perform a fetch request to a very simple API route in app/apizz/route.ts.
router.refresh() breaks the app if you use it after the fetch.
This doesn't happen if the API route exists in /pages/api
https://stackblitz.com/edit/vercel-next-js-mt4boz?file=app%2Fpage.tsx
Describe the Bug
The bug break the app when we try a redirection using router.push() after a fetch request to an API route in app/ directory
Expected Behavior
api routes in app directory should allow a redirection after a fetch request similar to pages/api.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-588
The text was updated successfully, but these errors were encountered: