Skip to content

Fix GitHub actions module import error #16526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

AbhiPrasad
Copy link
Member

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.ts to externalize specific modules during the server-side rendering (SSR) build:

  • The ssr.external option was added to vite.config.ts.
  • @prisma/instrumentation was explicitly added to the external array.
  • A regular expression ^@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.

@AbhiPrasad AbhiPrasad closed this Jun 9, 2025
Copy link
Contributor

github-actions bot commented Jun 9, 2025

⚠️ This PR is opened against master. You probably want to open it against develop.

@AbhiPrasad AbhiPrasad mentioned this pull request Jun 9, 2025
Copy link
Contributor

github-actions bot commented Jun 9, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.99 kB added added
@sentry/browser - with treeshaking flags 23.76 kB added added
@sentry/browser (incl. Tracing) 38.36 kB added added
@sentry/browser (incl. Tracing, Replay) 76.47 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.57 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 81.23 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 93.31 kB added added
@sentry/browser (incl. Feedback) 40.73 kB added added
@sentry/browser (incl. sendFeedback) 28.7 kB added added
@sentry/browser (incl. FeedbackAsync) 33.59 kB added added
@sentry/react 25.76 kB added added
@sentry/react (incl. Tracing) 40.35 kB added added
@sentry/vue 28.36 kB added added
@sentry/vue (incl. Tracing) 40.21 kB added added
@sentry/svelte 24.01 kB added added
CDN Bundle 25.48 kB added added
CDN Bundle (incl. Tracing) 38.53 kB added added
CDN Bundle (incl. Tracing, Replay) 74.41 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 79.86 kB added added
CDN Bundle - uncompressed 74.41 kB added added
CDN Bundle (incl. Tracing) - uncompressed 114.1 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 228.07 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 240.89 kB added added
@sentry/nextjs (client) 42.01 kB added added
@sentry/sveltekit (client) 38.84 kB added added
@sentry/node 150.28 kB added added
@sentry/node - without tracing 98.33 kB added added
@sentry/aws-serverless 124.1 kB added added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants