Storybook: [addons] - Cannot read property '__STORYBOOK_ADDONS' of undefined

Created on 22 Mar 2019  路  7Comments  路  Source: storybookjs/storybook

Describe the bug
When I run yarn dev, after pulling down the project, running yarn install and yarn bootstrap --reset --core, I get errors stating:

  • Could not find a declaration file for module 'telejson' (shows up on other addons)
  • Could not find a declaration file for module 'react-inspector' (shows up on other addons)
  • Property 'warn' does not exist on type 'typeof import(".../lib/client-logger/dist/index")

When I try to fix those by correctly importing warn and adding the types to the typings, I get this error when yarn linking to another project:
Cannot read property '__STORYBOOK_ADDONS' of undefined at getAddonsStore (index.ts:97) at Object.../storybook/lib/addons/dist/index.ts

After that error comes up, none of the components are listed in the side panel nor are they rendered in the iframe. I can't do any local development on Storybook until this is resolved.

To Reproduce
Steps to reproduce the behavior:

  1. Pull down a brand new copy of the project
  2. Run yarn install
  3. run yarn bootstrap --reset --core
  4. run yarn dev
  5. see errors

Expected behavior
Errors shouldn't appear during yarn dev run, and if resolved, I should be able to link an addon to another project and see the components being rendered as usual.

Screenshots
image
image
image

System:

  • OS: [MacOS]
  • Device: [Macbook Pro 2018]
  • Browser: [chrome, firefox]
  • Framework used in external project using link to local: [Angular]
  • Version: [NEXT - first seen as of local merge on 3-20 (but hadn't merged in since 3-15 when working on a feature). Continuing to see as of 3-22-19]
  • External project using the yarn link is using version: 5.1.0-alpha.12
addons inactive question / support

All 7 comments

@ndelangen @shilman could this have to do with the API changes that went in?

Why is lib/addons/dist/index.ts being loaded instead of lib/addons/dist.index.js

I think this is part of the problem.

Or might that just be a sourcemap?

I am not quite sure. Fixing the errors in the addon didnt solve the issue. Im using 5.1.0-alpha.12 in the external project and linking in the next version of storybook. Has an important change with the way addons work not been released that could be in next as of 3-15-19?

What I've shown is a clean slate project so it should be able to be replicated. Many other addons are having similar issues locally. Is anyone else able to see this issue when pulling down and running the commands?

@shilman, still not sure what is causing this problem but I am able to continue development without linking using the cra-kitchen-sink. I should be good for now.

@CodeByAlex I suggest using official-storybook since it uses the --no-dll flag and therefore works with yarn dev.

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xogeny picture xogeny  路  3Comments

oriSomething picture oriSomething  路  3Comments

purplecones picture purplecones  路  3Comments

ZigGreen picture ZigGreen  路  3Comments

sakulstra picture sakulstra  路  3Comments