From 996b00b78708ece4d584c9a81b5460a1bdb752e6 Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Mon, 24 Oct 2022 19:40:18 +0200 Subject: [PATCH] =?UTF-8?q?[Tiny]=C2=A0Fixed=20incorrect=20import=20in=20`?= =?UTF-8?q?react-server-dom-webpack`=20(#25554)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary In https://github.com/facebook/react/pull/25504, `react-server-dom-webpack/` was deprecated in favor of `react-server-dom-webpack/client`, but a remaining import wasn't adjusted accordingly. As a result, the remaining conditions within the file are no longer firing appropriately, which I ran into while playing around with a fork of [server-components-demo](https://github.com/reactjs/server-components-demo). The `index.js` file now contains a [placeholder](https://github.com/facebook/react/blob/main/packages/react-server-dom-webpack/index.js) and the actual logic of the client now sits in `/client`. ## How did you test this change? I replaced `require.resolve('../')` with `require.resolve('../client')` in the `react-server-dom-webpack` package in `node_modules` and confirmed that the output of the build looked good again. --- .../react-server-dom-webpack/src/ReactFlightWebpackPlugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js b/packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js index a06bae9563631..9182597c2b85a 100644 --- a/packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js +++ b/packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js @@ -40,7 +40,7 @@ class ClientReferenceDependency extends ModuleDependency { // without the client runtime so it's the first time in the loading sequence // you might want them. const clientImportName = 'react-server-dom-webpack/client'; -const clientFileName = require.resolve('../'); +const clientFileName = require.resolve('../client'); type ClientReferenceSearchPath = { directory: string,