npm i -g @storybook/cli
# This command adds a set of boilerplate files for Storybook in your project. You also need to update storybook configuration for Gatsby project.
sb init
"storybook:static-query": "yarn clean && yarn build && cp -r ./public/page-data/sq/d ./public/static",
"storybook": "yarn storybook:static-query && NODE_ENV=test start-storybook -p 6006 -s public",
Create a directory called stories inside of src/components and add create a new file called example.stories.js. Storybook will automatically pick up all files ending with ...stories.js
Error: Cannot read property 'createSnapshot' of undefined
TypeError: Cannot read property 'get' of undefined
UnhandledPromiseRejectionWarning: TypeError: compilation.getAssetPath is not a function
If you run into this issues when using NPM, just remove rm -rf node_modules/
and rm package-lock.json
then, run yarn install;yarn storybook