mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Request data flow in the server
```
request ---> router worker (1) ---> ipc ---> render worker app (2)
|-----> render worker pages (3)
```
When it's hitting `_next/*` unmatched routes in standalone server, it will render 404, but when you hit `_next/*` it will render app not-found as the app router is always enabled, but router worker isn't set up with require-hook for proper built-in react version, then the app-render will fail with `./server.edge` exports not found error.
We detect if it's in the render worker, then do the app paths rendering instead of directly looking up for app paths in route worker. This could avoid unexpected accesses to the app-render
Fixes #51482
Fixes #50232
Closes #51506
Reverts changes in #51172
fix NEXT-1260
17 lines
343 B
JavaScript
17 lines
343 B
JavaScript
import useSWR, { useSWRConfig } from 'swr'
|
|
|
|
export default function Page({ foo }) {
|
|
const { data } = useSWR('hello', (v) => v, { fallbackData: 'hello' })
|
|
useSWRConfig() // call SWR context
|
|
|
|
return <div id="content">{`${data}-${foo}`}</div>
|
|
}
|
|
|
|
export function getServerSideProps() {
|
|
return {
|
|
props: {
|
|
foo: 'bar',
|
|
},
|
|
}
|
|
}
|