-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'STORYBOOK_HOOKS_CONTEXT' of undefined #8083
Comments
@Hypnosphi any ideas here? |
there is a reference to storybook/lib/addons/src/hooks.ts Line 147 in b41b3ab
but |
## [4.6.3](v4.6.2...v4.6.3) (2019-09-16) ### Bug Fixes * **deps:** Locking storybook version to avoid Storybook issue storybookjs/storybook#8083 ([3aa472a](3aa472a)) * **windows:** Move postInstall commands to their own script; add command to kill metro ([#247](#247) by [@bryanstearns](https://github.com/bryanstearns)) ([d5e878d](d5e878d))
As a temporary workaround you can do: import initStoryshots from "@storybook/addon-storyshots"
import { merge } from "lodash-es"
jest.mock("global", () => merge(global, { window: { STORYBOOK_HOOKS_CONTEXT: "" } }));
describe("storybook tests", () => {
initStoryshots({
configPath: "./storybook",
framework: "react-native"
})
}) |
@loic-lopez when I tried your code(to solve this problem) I got this error message in console:
Could you please help me, what I did wrong? |
@vladstart1 I have imported Your error: Invalid variable access: merge You can do:
|
Olé!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.0-alpha.1 containing PR #8163 that references this issue. Upgrade today to try it out! You can find this prerelease on the Closing this issue. Please re-open if you think there's still more to do. |
Yee-haw!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.2 containing PR #8163 that references this issue. Upgrade today to try it out! |
Describe the bug
When running
initStoryshots
fromimport initStoryshots from "@storybook/addon-storyshots"
an error occurs when storyshots starts.
Code snippets
Storyshot code:
Error from console:
System:
The text was updated successfully, but these errors were encountered: