generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 88
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