-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Don't insert Svelte preprocessor code in script module in Svelte 5. #17113
Copy link
Copy link
Closed
Description
Here is the diff that solved my problem:
diff --git a/node_modules/@sentry/svelte/build/esm/preprocessors.js b/node_modules/@sentry/svelte/build/esm/preprocessors.js
index 62f0b46..600c653 100644
--- a/node_modules/@sentry/svelte/build/esm/preprocessors.js
+++ b/node_modules/@sentry/svelte/build/esm/preprocessors.js
@@ -95,7 +95,7 @@ function shouldInjectFunction(
// because the code inside is not executed when the component is instantiated but
// when the module is first imported.
// see: https://svelte.dev/docs#component-format-script-context-module
- if (attributes.context === 'module') {
+ if (attributes.module || attributes.context === 'module') {
return false;
}
The attributes changed in Svelte 5. In asynchronously loaded components it started to fail.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Waiting for: Product Owner