From d7a0609605a3dbd4eafb1393cdd36cc98b6533a4 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 8 Jan 2025 13:48:29 +0800 Subject: [PATCH] fix --- .../src/build-utils/build/module-graph/webpack/transform.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/src/build-utils/build/module-graph/webpack/transform.ts b/packages/core/src/build-utils/build/module-graph/webpack/transform.ts index eab67648..9b3900f3 100644 --- a/packages/core/src/build-utils/build/module-graph/webpack/transform.ts +++ b/packages/core/src/build-utils/build/module-graph/webpack/transform.ts @@ -59,12 +59,15 @@ function appendDependency( webpackGraph: Webpack.ModuleGraph, graph: ModuleGraph, ) { + // Rspack does not support `getResolvedModule` yet. const resolvedWebpackModule = webpackGraph?.getResolvedModule ? (webpackGraph.getResolvedModule(webpackDep) as Webpack.NormalModule) : undefined; + if (!resolvedWebpackModule) { return; } + const rawRequest = getWebpackDependencyRequest( webpackDep, resolvedWebpackModule,