diff --git a/packages/astro/src/core/build/generate.ts b/packages/astro/src/core/build/generate.ts index cced4547948a4..d245233a01e5a 100644 --- a/packages/astro/src/core/build/generate.ts +++ b/packages/astro/src/core/build/generate.ts @@ -311,6 +311,9 @@ async function generatePath( scripts, renderers, async resolve(specifier: string) { + if (specifier.endsWith('.jsx')) { + specifier = specifier.slice(0, -4); + } const hashedFilePath = internals.entrySpecifierToBundleMap.get(specifier); if (typeof hashedFilePath !== 'string') { // If no "astro:scripts/before-hydration.js" script exists in the build,