Fix GitHub actions module import error #16526
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The GitHub Actions failure, specifically a
SyntaxError: The requested module '@prisma/instrumentation' does not provide an export named 'default', was addressed by modifying the Vite configuration in the SvelteKit test application.The error occurred because SvelteKit's build process, powered by Vite, was incorrectly transforming the import statement for
@prisma/instrumentation. This package uses named exports, but the bundler attempted to import a non-existent default export.The fix involved updating
dev-packages/e2e-tests/test-applications/sveltekit-2-svelte-5/vite.config.tsto externalize specific modules during the server-side rendering (SSR) build:ssr.externaloption was added tovite.config.ts.@prisma/instrumentationwas explicitly added to theexternalarray.^@opentelemetry\/instrumentation/was added to externalize all OpenTelemetry instrumentation packages, anticipating similar issues.This change instructs Vite/SvelteKit to not bundle these modules, preserving their original import statements and allowing Node.js to handle their resolution at runtime, thereby preventing the incorrect CommonJS-to-ESM transformation that caused the build error.