diff --git a/.changeset/empty-oranges-provide.md b/.changeset/empty-oranges-provide.md new file mode 100644 index 000000000..6785353a8 --- /dev/null +++ b/.changeset/empty-oranges-provide.md @@ -0,0 +1,7 @@ +--- +'astro': patch +--- + +Fixes regression in build caused by use of URL module + +Using this module breaks the build because Vite tries to shim it, incorrectly. diff --git a/packages/astro/src/runtime/server/index.ts b/packages/astro/src/runtime/server/index.ts index 010474b2b..9e0d75f48 100644 --- a/packages/astro/src/runtime/server/index.ts +++ b/packages/astro/src/runtime/server/index.ts @@ -2,7 +2,6 @@ import type { AstroComponentMetadata, Renderer } from '../../@types/astro'; import type { AstroGlobalPartial, SSRResult, SSRElement } from '../../@types/astro'; import shorthash from 'shorthash'; -import { pathToFileURL } from 'url'; import { extractDirectives, generateHydrateScript } from './hydration.js'; import { serializeListValue } from './util.js'; export { createMetadata } from './metadata.js'; @@ -289,7 +288,7 @@ function createFetchContentFn(url: URL) { // Inside of getStaticPaths. export function createAstro(fileURLStr: string, site: string, projectRootStr: string): AstroGlobalPartial { const url = new URL(fileURLStr); - const projectRoot = projectRootStr === '.' ? pathToFileURL(process.cwd()) : new URL(projectRootStr); + const projectRoot = new URL(projectRootStr); const fetchContent = createFetchContentFn(url); return { site: new URL(site),