Skip to content

Commit

Permalink
Revert react-server-dom require change (#55345)
Browse files Browse the repository at this point in the history
Reverts a piece of #55287 which seems to break edge-functions. We'll need to investigate an alternative and add a test case to ensure it fixes the case as expected. 

```sh
Error: The Edge Function "hello/world/dashboard/another-edge" is referencing unsupported modules:
--
- index.js: react-server-dom-webpack/client.edge
```

x-ref: https://github.com/vercel/vercel/actions/runs/6177961848/job/16770369085?pr=10504#step:9:308
  • Loading branch information
ijjk committed Sep 13, 2023
1 parent 14e94e6 commit 2d354ac
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/next/src/server/app-render/use-flight-response.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ export function useFlightResponse(
if (flightResponseRef.current !== null) {
return flightResponseRef.current
}
// react-server-dom-webpack/client.edge must not be hoisted for require cache clearing to work correctly
const { createFromReadableStream } = process.env.NEXT_MINIMAL
? // @ts-ignore
__non_webpack_require__(`react-server-dom-webpack/client.edge`)
: require(`react-server-dom-webpack/client.edge`)
const {
createFromReadableStream,
} = require(`react-server-dom-webpack/client.edge`)

const [renderStream, forwardStream] = req.tee()
const res = createFromReadableStream(renderStream, {
Expand Down

0 comments on commit 2d354ac

Please sign in to comment.