From 9041e19585dc2679d558ec51e77fd1ea1bacdb2b Mon Sep 17 00:00:00 2001 From: patak Date: Thu, 4 May 2023 10:58:43 +0200 Subject: [PATCH] fix: unwrapId and pass ssr flag when adding to moduleGraph in this.load (#13083) --- packages/vite/src/node/server/pluginContainer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/node/server/pluginContainer.ts b/packages/vite/src/node/server/pluginContainer.ts index 38c057bbbf8c29..ce851e8d2b24ec 100644 --- a/packages/vite/src/node/server/pluginContainer.ts +++ b/packages/vite/src/node/server/pluginContainer.ts @@ -76,6 +76,7 @@ import { numberToPos, prettifyUrl, timeFrom, + unwrapId, } from '../utils' import { FS_PREFIX } from '../constants' import type { ResolvedConfig } from '../config' @@ -313,7 +314,7 @@ export async function createPluginContainer( } & Partial>, ): Promise { // We may not have added this to our module graph yet, so ensure it exists - await moduleGraph?.ensureEntryFromUrl(options.id) + await moduleGraph?.ensureEntryFromUrl(unwrapId(options.id), this.ssr) // Not all options passed to this function make sense in the context of loading individual files, // but we can at least update the module info properties we support updateModuleInfo(options.id, options)