storybook-addon-mock
storybook-addon-mock copied to clipboard
Uncaught TypeError: Object(...) is not a function looped error @ faker.js matchMock
Mocking requests works fine, but there's an infinite loop causing excessive resources usage, which prevents us from releasing code to server.
Storybook configuration:
"@dreamworld/addon-redux": "^1.1.0",
"@storybook/addon-actions": "^6.5.15",
"@storybook/addon-essentials": "^6.5.15",
"@storybook/addon-links": "^6.5.15",
"@storybook/preset-scss": "^1.0.3",
"@storybook/react": "^6.5.15",
"@storybook/storybook-deployer": "^2.8.16",
"storybook-addon-mock": "3.2.0"
Downgrading to versions 3.1.0 and 3.0.0 did not help - with these versions story preview does not show at all (error).
Before adding storybook-addon-mock everything worked as expected.
The callback function in matchMock method in esm/utils/faker.js receives '/runtime-error' as a parameter (url) but there is no request like this made anywhere by the app so I assume this is some Storybook internals.
The bug is quite serious because even navigating away from the story using the storybook-addon-mock does not stop the overflow.
I'd be very happy to see a solution/work-around for this issue as it prevents us from using our most crucial stories.
Thanks!
happens for me as well with the latest version 4.0.0 and SB v.7
@hanna-seraya @hardfi do you have any sandbox to reproduce this issue?