Skip to content
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

[Angular 6.2.x] Cannot find module @storybook/angular #15311

Closed
ghost opened this issue Jun 21, 2021 · 4 comments
Closed

[Angular 6.2.x] Cannot find module @storybook/angular #15311

ghost opened this issue Jun 21, 2021 · 4 comments

Comments

@ghost
Copy link

ghost commented Jun 21, 2021

Describe the bug
I am trying to setup Storybook for Angular 8, however when running npm run storybook I am getting the following errors:

ERROR in /home/user/dev/storybook/src/stories/Button.stories.ts
ERROR in /home/user/dev/storybook/src/stories/Button.stories.ts(2,29):
TS2307: Cannot find module '@storybook/angular/types-6-0'.

ERROR in /home/user/dev/storybook/src/stories/Header.stories.ts
ERROR in /home/user/dev/storybook/src/stories/Header.stories.ts(1,32):
TS2307: Cannot find module '@storybook/angular'.

ERROR in /home/user/dev/storybook/src/stories/Header.stories.ts
ERROR in /home/user/dev/storybook/src/stories/Header.stories.ts(4,29):
TS2307: Cannot find module '@storybook/angular/types-6-0'.

ERROR in /home/user/dev/storybook/src/stories/Page.stories.ts
ERROR in /home/user/dev/storybook/src/stories/Page.stories.ts(1,45):
TS2307: Cannot find module '@storybook/angular'.

To Reproduce
Unable to create a reproducible test case as Angular 8 is not listed in npx sb@next repro and the node version I am using node@10.12 does not support the versions listed.

System

Environment Info:

  System:
    OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (6) x64 Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
  Binaries:
    Node: 10.12.0 - ~/.nvm/versions/node/v10.12.0/bin/node
    npm: 6.4.1 - ~/.nvm/versions/node/v10.12.0/bin/npm
  npmPackages:
    @storybook/addon-actions: ^6.2.9 => 6.2.9 
    @storybook/addon-essentials: ^6.2.9 => 6.2.9 
    @storybook/addon-links: ^6.2.9 => 6.2.9 
    @storybook/angular: ^6.2.9 => 6.2.9

Additional context

My current package.json

NPM output while running npm run storybook

Steps I've already tried:

  • Importing everything from @storybook/angular and not using @storybook/angular/types-6-0 Source
  • Adding @storybook/angular/types-6-0 to .storybook/typings.d.ts Source
  • Adding ../src/setupJest.ts to the exclude array in .storybook/tsconfig.json Source
  • Adding "enableIvy": false to tsconfig.json under "angularCompilerOptions"

Vscode can see the modules just fine:

image

Notes
Although I am sure that Angular 8 is not supported by Storybook, I would still like some help as I am getting a lot of pressure from my bosses to "do the needful and whip up the thing for us" so we can have a components library. Sadly, upgrading Angular or node is not an option at the moment.

I have also created a question on StackOverflow for this exact situation.

@shilman
Copy link
Member

shilman commented Jun 21, 2021

Have you tried upgrading to the latest prerelease?

npx sb@next upgrade --prerelease

@ghost
Copy link
Author

ghost commented Jun 21, 2021

@shilman Same error, sadly.

I have included the full npm output when running npm run storybook in the original post

@EliHowey
Copy link

I think this might be related to an issue I wrote a few weeks ago: #15196

For this issue, notice that the Storybook is compiling with TypeScript v3.5.3, but VS Code's Intellisense is pointing to the ts3.9 types.

@shilman
Copy link
Member

shilman commented Jun 7, 2023

We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid.

Please open a new issue referencing this one if:

@shilman shilman closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants