From 5a2103f0d486a7725c23c70710b11559c00e9b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Thu, 14 Nov 2024 17:13:15 +0900 Subject: [PATCH] fix: include more modules to prefix-only module list (#18667) --- packages/vite/src/module-runner/evaluatedModules.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/module-runner/evaluatedModules.ts b/packages/vite/src/module-runner/evaluatedModules.ts index 51902964cd2e28..36e664271ea159 100644 --- a/packages/vite/src/module-runner/evaluatedModules.ts +++ b/packages/vite/src/module-runner/evaluatedModules.ts @@ -124,7 +124,13 @@ export class EvaluatedModules { } // unique id that is not available as "$bare_import" like "test" -const prefixedBuiltins = new Set(['node:test', 'node:sqlite']) +// https://nodejs.org/api/modules.html#built-in-modules-with-mandatory-node-prefix +const prefixedBuiltins = new Set([ + 'node:sea', + 'node:sqlite', + 'node:test', + 'node:test/reporters', +]) // transform file url to id // virtual:custom -> virtual:custom