rsnext/packages/next
Jiachi Liu d8f4fa8946
Fix not found hangs the build with overridden node env (#53106)
### Why

In #52985 the not found solution introduces `NODE_ENV` to determine if it his the not found boundary and should render the not found, as in the next build mode, we have `/_not-found` as a special route which has a empty parallel route, but in next dev mode so far it his the `parallel-default-route`. This could dependend on the `NODE_ENV` passing to next server but not necessarily.

### What

Fixes #53082
Fixes #53083 

### How

When server actions `not-found` hits, now we create a new loader tree based on the previous one, including `layout` and other components but not the children parallel routes

For production case, to make the rendering independent from the `NODE_ENV`, we're using original pathname to check if it's `/_not-found` to determine if it's production build 404 page

To support replace the loader tree of action, did a little refactor that passing down the loader tree from top level to `bodyResult`. Then we can change the loader tree itself before rendering, in short, we tweak it from original tree to one for not-found case, so server actions could render it properly
2023-07-24 21:00:53 +00:00
..
compat
font Remove experimental fontLoaders option from next.config.js (#46886) 2023-03-13 21:34:43 +00:00
image-types Add unstable_getImgProps export from next/image (#51205) 2023-06-29 01:35:08 +00:00
legacy
navigation-types/compat Return null for useParams in pages (#47490) 2023-03-25 10:05:44 +01:00
src Fix not found hangs the build with overridden node env (#53106) 2023-07-24 21:00:53 +00:00
types fix(next/jest): jest can not load server-only code (#52393) 2023-07-12 08:51:29 +00:00
amp.d.ts
amp.js
app.d.ts
app.js
babel.d.ts
babel.js
cache.d.ts Update cache methods for app dir (#49165) 2023-05-03 13:21:58 -07:00
cache.js Update cache methods for app dir (#49165) 2023-05-03 13:21:58 -07:00
client.d.ts
client.js
config.d.ts
config.js
constants.d.ts
constants.js
document.d.ts
document.js
dynamic.d.ts
dynamic.js
error.d.ts
error.js
head.d.ts
head.js
headers.d.ts
headers.js
image.d.ts Add unstable_getImgProps export from next/image (#51205) 2023-06-29 01:35:08 +00:00
image.js Add unstable_getImgProps export from next/image (#51205) 2023-06-29 01:35:08 +00:00
index.d.ts Update revalidate handling for app (#49062) 2023-05-02 08:19:02 -07:00
jest.d.ts
jest.js
license.md
link.d.ts
link.js
navigation.d.ts
navigation.js
package.json v13.4.12 2023-07-21 20:30:24 +00:00
README.md
router.d.ts
router.js
script.d.ts
script.js
server.d.ts Update revalidate handling for app (#49062) 2023-05-02 08:19:02 -07:00
server.js Update revalidate handling for app (#49062) 2023-05-02 08:19:02 -07:00
taskfile-ncc.js
taskfile-swc.js fix: webpack target should match node engines (#51852) 2023-06-26 22:15:44 +00:00
taskfile-watch.js
taskfile.js Update vendor @vercel/og (#52897) 2023-07-19 21:04:27 +00:00
tsconfig.json next/navigation Typescript support for pages/ (#45919) 2023-02-14 17:26:01 -08:00
web-vitals.d.ts add useReportWebVitals that makes use of web-vitals package (#47319) 2023-03-24 10:13:50 +00:00
web-vitals.js add useReportWebVitals that makes use of web-vitals package (#47319) 2023-03-24 10:13:50 +00:00

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 that have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.

Authors

Security

If you believe you have found a security vulnerability in Next.js, we encourage you to responsibly disclose this and not open a public issue. We will investigate all legitimate reports. Email security@vercel.com to disclose any security vulnerabilities.

https://vercel.com/security