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

[Bug] Unable to compile TypeScript #559

Open
1 task
IleniaTedde opened this issue Feb 10, 2023 · 2 comments
Open
1 task

[Bug] Unable to compile TypeScript #559

IleniaTedde opened this issue Feb 10, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@IleniaTedde
Copy link

What version of vite are you using?

3.2.5

System info and storybook versions

System:
OS: macOS 12.2
CPU: (8) arm64 Apple M1
Binaries:
Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.13.0/bin/yarn
npm: 9.4.2 - ~/.nvm/versions/node/v16.13.0/bin/npm
Browsers:
Chrome: 109.0.5414.119
Firefox: 109.0
Safari: 15.3
npmPackages:
@storybook/addon-essentials: ^6.5.15 => 6.5.16
@storybook/builder-vite: ^0.2.6 => 0.2.7
@storybook/core-common: ^6.5.16 => 6.5.16
@storybook/core-server: ^6.5.15 => 6.5.16
@storybook/html: ^6.5.15 => 6.5.16
@storybook/web-components: ^6.5.15 => 6.5.16

Describe the Bug

Hello, i'm using nx to manage a monorepo and when i run storybook it give me the following errors:

nx run vehicle-header:storybook

info @storybook/web-components v6.5.16
info
ERR! TSError: ⨯ Unable to compile TypeScript:
ERR! packages/vehicle-header/.storybook/main.ts:2:47 - error TS2792: Cannot find module '@storybook/core-common'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
ERR!
ERR! 2 import type { StorybookConfig, Options } from '@storybook/core-common';
ERR! ~~~~~~~~~~~~~~~~~~~~~~~~
ERR! packages/vehicle-header/.storybook/main.ts:6:29 - error TS2792: Cannot find module 'vite'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
ERR!
ERR! 6 import { mergeConfig } from 'vite'
ERR! ~~~~~~
ERR! packages/vehicle-header/.storybook/main.ts:7:31 - error TS2792: Cannot find module 'vite-tsconfig-paths'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
ERR!
ERR! 7 import viteTsConfigPaths from 'vite-tsconfig-paths'

Do you know how can i resolve this issue?

Link to Minimal Reproducible Example

No response

Participation

  • I am willing to submit a pull request for this issue.
@b3nab
Copy link

b3nab commented Feb 13, 2023

This issue seems similar to #298 but no one yet have a solution. Someone know a workaround for this error?

@IanVS
Copy link
Member

IanVS commented Feb 16, 2023

Did you mean to set the 'moduleResolution' option to 'node'

What are your module and moduleResolution set to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants