Skip to content

Error when building SvelteKit app with Vite >=6 #15365

@bolinocroustibat

Description

@bolinocroustibat

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/sveltekit

SDK Version

9.0.0

Framework Version

SvelteKit 2.17.1 & Vite 6.1.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

@sentry/sveltekit": "^9.0.0" as a dependency
When building with Vite>=6 and Bun==1.2.2, one get the following error:

[vite-plugin-sveltekit-compile] [commonjs--resolver] Failed to resolve entry for package "@sentry/sveltekit". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "@sentry/sveltekit" package
[commonjs--resolver] Failed to resolve entry for package "@sentry/sveltekit". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "@sentry/sveltekit" package

This doesn't happen with Vite<6.0.0, as it was tested with multiple configurations.

Steps to Reproduce

Create a project with:

@sveltejs/kit": "^2.17.1
@sentry/sveltekit": "^9.0.0"
"vite": "^6.0.0"

Use Bun==1.2.2as the bundler.

Expected Result

We would expect a successful build on Vite>=6, as it is the case with the same @sentry/sveltekit.

Actual Result

When building with Vite>=6 one get the following error:

[vite-plugin-sveltekit-compile] [commonjs--resolver] Failed to resolve entry for package "@sentry/sveltekit". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "@sentry/sveltekit" package
[commonjs--resolver] Failed to resolve entry for package "@sentry/sveltekit". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "@sentry/sveltekit" package

This doesn't happen with Vite<6.0.0, as it was tested with multiple configurations.

Metadata

Metadata

Assignees

Labels

BugPackage: sveltekitIssues related to the Sentry SvelteKit SDK

Projects

Status

Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions