Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion createEnvironment.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function createEnvironment({baseEnvironment} = {}) {

const [config, context] = args;

this.options = config.projectConfig.testEnvironmentOptions?.sentryConfig;
this.options = structuredClone(config.projectConfig.testEnvironmentOptions?.sentryConfig)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

structuredClone throws on configs containing functions

Medium Severity

structuredClone throws a DataCloneError if the sentryConfig object (or its nested init property) contains any function values. Sentry's init options commonly include callbacks like beforeSend, tracesSampler, beforeBreadcrumb, or integrations as a function. Users passing any of these will now get a runtime error that didn't exist before this change. A shallow spread of only the mutated paths (init and init.integrations) would avoid this while still preventing the shared-config mutation the PR intends to fix.

Fix in Cursor Fix in Web


if (
!this.options ||
Expand Down
Loading