generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
Description
Describe the bug
When serializing console.log/.error/etc. arguments, decirc calls setReplace when the depthLimit is hit or a circular reference is detected, which modifies the argument in place unless it's a non-configurable property with a getter.
That means that if window is logged, it ends up changing the value of global variables such as __STORYBOOK_ADDONS_CHANNEL__, which in turn leads to errors like page.evaluate: TypeError: channel.on is not a function.
To Reproduce
- Clone https://github.com/vhfmag/storybook-test-runner-serialization-bug
- Run
pnpm install && pnpm test
System
│ Storybook Environment Info:
│
│ System:
│ OS: macOS 15.7.3
│ CPU: (12) arm64 Apple M4 Pro
│ Shell: 5.9 - /bin/zsh
│ Binaries:
│ Node: 22.22.0 - /Users/vhfmag/.volta/tools/image/node/22.22.0/bin/node
│ npm: 10.9.4 - /Users/vhfmag/.volta/tools/image/node/22.22.0/bin/npm
│ pnpm: 10.18.0 - /Users/vhfmag/.volta/bin/pnpm <----- active
│ Browsers:
│ Chrome: 143.0.7499.193
│ Safari: 18.6
│ npmPackages:
│ @storybook/addon-a11y: ^10.2.0-beta.0 => 10.2.0-beta.0
│ @storybook/addon-docs: ^10.2.0-beta.0 => 10.2.0-beta.0
│ @storybook/addon-onboarding: ^10.2.0-beta.0 => 10.2.0-beta.0
│ @storybook/addon-webpack5-compiler-swc: ^4.0.2 => 4.0.2
│ @storybook/react-webpack5: ^10.2.0-beta.0 => 10.2.0-beta.0
│ @storybook/test-runner: ^0.24.2 => 0.24.2
│ storybook: ^10.2.0-beta.0 => 10.2.0-beta.0Additional context
No response
Reactions are currently unavailable