Skip to content

@sentry/svelte is not a proper ESM package #10360

Closed as not planned
Closed as not planned
@GauBen

Description

@GauBen

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/svelte

SDK Version

7.98.0

Framework Version

Svelte 4

Link to Sentry event

No response

SDK Setup

None needed

Steps to Reproduce

https://stackblitz.com/edit/stackblitz-starters-h72nkr?file=index.js

  1. Use "type": "module" in package.json
  2. Import @sentry/svelte in Node.js

Expected Result

Should work

Actual Result

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/projects/stackblitz-starters-h72nkr/node_modules/svelte/src/runtime/ssr.js from /home/projects/stackblitz-starters-h72nkr/node_modules/@sentry/svelte/cjs/performance.js not supported.
Instead change the require of ssr.js in /home/projects/stackblitz-starters-h72nkr/node_modules/@sentry/svelte/cjs/performance.js to a dynamic import() which is available in all CommonJS modules.

The cause of this error is correctly described by https://publint.dev/@sentry/svelte@7.98.0

### Tasks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions