No description
ee605cb653
The fix in PR #25749 only works some of the time. The reason why it doesn't work all of the time is because the `devBuildResolve` function is called when the assets have been built, but this can happen before the `getFilesForRoute` promise chain has completed, and thus the `cancelled` variable could not yet have been updated. To fix this we wait for the `getFilesForRoute` promise chain to be fulfilled and then resolve the `devBuildPromise` promise afterwards. This allows the `getFilesForRoute` promise chain to be fulfilled before and the `cancelled` variable can be updated accordingly. If an error is thrown somewhere in the `getFilesForRoute` promise chain, i.e. due to a failed fetch request, then that will also resolve the `devBuildPromise` and the error will bubble up to ultimately become a `routeChangeError` which will reload the page. With this fix the need to listen for HMR events has become obsolete as regardless of when the HMR build/sync events complete we still want to ensure that the `getFilesForRoute` promise chain has been fulfilled before resolving the `devBuildPromise`. Co-authored-by: Tobias Järvelöv <tobias.jarvelov@oderland.se> Co-authored-by: JJ Kasper <jj@jjsweb.site> |
||
---|---|---|
.github | ||
.vscode | ||
bench | ||
docs | ||
errors | ||
examples | ||
packages | ||
scripts | ||
test | ||
.alexignore | ||
.alexrc | ||
.eslintignore | ||
.eslintrc.json | ||
.gitignore | ||
.npmrc | ||
.prettierignore | ||
.prettierignore_staged | ||
.prettierrc.json | ||
azure-pipelines.yml | ||
CODE_OF_CONDUCT.md | ||
contributing.md | ||
data.sqlite | ||
jest.config.js | ||
lerna.json | ||
license.md | ||
lint-staged.config.js | ||
package.json | ||
readme.md | ||
release.js | ||
run-tests.js | ||
SECURITY.md | ||
skip-docs-change.js | ||
test-file.txt | ||
UPGRADING.md | ||
vercel.json | ||
yarn.lock |
Next.js
Getting Started
Visit https://nextjs.org/learn to get started with Next.js.
Documentation
Visit https://nextjs.org/docs to view the full documentation.
Who is using Next.js?
Next.js is used by the world's leading companies. Check out the Next.js Showcase to learn more.
Community
The Next.js community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects.
To chat with other community members you can join the Next.js Discord.
Our Code of Conduct applies to all Next.js community channels.
Contributing
Please see our contributing.md.
Good First Issues
We have a list of good first issues that contain bugs which have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.
Authors
- Tim Neutkens (@timneutkens) – Vercel
- Naoyuki Kanezawa (@nkzawa) – Vercel
- Guillermo Rauch (@rauchg) – Vercel
- Arunoda Susiripala (@arunoda)
- Tony Kovanen (@tonykovanen)
- Dan Zajdband (@impronunciable)