From c0099703338cf81e2b381e6e754c73b442db4eab Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Mon, 8 May 2023 19:33:08 +0800 Subject: [PATCH] Fix `astro:assets` SSR error (#7034) --- .changeset/green-chefs-build.md | 5 +++++ packages/astro/src/core/create-vite.ts | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/green-chefs-build.md diff --git a/.changeset/green-chefs-build.md b/.changeset/green-chefs-build.md new file mode 100644 index 000000000..d1669c826 --- /dev/null +++ b/.changeset/green-chefs-build.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix `astro:assets` SSR error diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index ab7208b7d..89dec9d4b 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -58,6 +58,8 @@ const ONLY_DEV_EXTERNAL = [ 'shiki', // Imported by `@astrojs/prism` which exposes `` that is processed by Vite 'prismjs/components/index.js', + // Imported by `astro/assets` -> `packages/astro/src/core/logger/core.ts` + 'string-width', ]; /** Return a common starting point for all Vite actions */