-
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-650] Renaming/removing on app dir page causes dev script to output the error modal on any subsequent requests #46379
Labels
bug
Issue was opened via the bug report template.
linear: next
Confirmed issue that is tracked by the Next.js team.
Comments
timneutkens
added
the
linear: next
Confirmed issue that is tracked by the Next.js team.
label
Feb 27, 2023
timneutkens
changed the title
Renaming/removing on app dir page causes dev script to output the error modal on any subsequent requests
[NEXT-650] Renaming/removing on app dir page causes dev script to output the error modal on any subsequent requests
Feb 27, 2023
11 tasks
kodiakhq bot
pushed a commit
that referenced
this issue
Feb 28, 2023
…46583) Currently if a file or folder (that contains an entry) is renamed in app dir, the dev server will stop working because we never remove the old entry. Since all client entries in app dir are created as child entries programmatically via the RSC plugin, they're different and not handled by our existing hot reloader logic: https://github.com/vercel/next.js/blob/f0cbe84e4c2ed159df70a926d2f8f23b4c1025c9/packages/next/src/server/dev/hot-reloader.ts#L666-L677 This PR adds a file path to child entries as well (it can be layout, page and other entries) so in the entry generation step we can prune the invalid ones. Fixes #46379, fixes NEXT-650. ## Bug - [ ] Related issues linked using `fixes #number` - [x] 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)
huozhi
pushed a commit
to huozhi/next.js
that referenced
this issue
Feb 28, 2023
…ercel#46583) Currently if a file or folder (that contains an entry) is renamed in app dir, the dev server will stop working because we never remove the old entry. Since all client entries in app dir are created as child entries programmatically via the RSC plugin, they're different and not handled by our existing hot reloader logic: https://github.com/vercel/next.js/blob/f0cbe84e4c2ed159df70a926d2f8f23b4c1025c9/packages/next/src/server/dev/hot-reloader.ts#L666-L677 This PR adds a file path to child entries as well (it can be layout, page and other entries) so in the entry generation step we can prune the invalid ones. Fixes vercel#46379, fixes NEXT-650. ## Bug - [ ] Related issues linked using `fixes #number` - [x] 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 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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bug
Issue was opened via the bug report template.
linear: next
Confirmed issue that is tracked by the Next.js team.
Verify canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000
Binaries:
Node: 18.5.0
npm: 8.12.1
Yarn: 1.22.17
pnpm: 7.17.0
Relevant packages:
next: 13.2.1-canary.0
eslint-config-next: 13.2.1
react: 18.2.0
react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), CLI (create-next-app), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue
https://github.com/bruno12mota/next-rename-bug
To Reproduce
npm run dev
/src/app/about
folder to something else like/src/app/aboutme
Failed to compile
errorDescribe the Bug
Using the experimental app dir if your page consumes a client component and a folder is renamed, the dev script enters an error state that you can't come out of, unless you restart the dev script, at which point it no longer errors and works normally.
In the git repo i create, the about route has a page that is consuming an
about-content
file which is a client component, without any client components this error doesn't happen from what i could tell.Expected Behavior
I'd expect for the dev server to eventually reconcile the path change and not output the error modal on every request. Right now i have to restart the dev server every time i make a routing change.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-650
The text was updated successfully, but these errors were encountered: