Skip to content

Commit cd9a909

Browse files
committed
take care of node_modules client modules
1 parent dfa953b commit cd9a909

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/middleware/lib/rsc-handler-worker.ts

+4
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ const getDecodeId = async (loadClientEntries: boolean, isBuild: boolean) => {
201201
const baseDir = isBuild ? path.join(dir, distPath) : dir;
202202
if (id.startsWith(baseDir)) {
203203
id = basePath + getClientEntry(path.relative(baseDir, id));
204+
} else if (id.startsWith(path.join(dir, "node_modules"))) {
205+
id =
206+
basePath +
207+
getClientEntry(path.relative(path.join(dir, "node_modules"), id));
204208
} else {
205209
if (isBuild || process.env.NODE_ENV === "production") {
206210
throw new Error("decodeId: no relative path in production: " + id);

0 commit comments

Comments
 (0)