-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Storybook + Vite: wrong root for vite-tsconfig-paths plugin #15407
Comments
Hello @sebastiandg7 ! Thanks for filing an issue! I unfortunately cannot reproduce your issue. Here is my reproduction repository. Please read the README. Make sure you are on branch Can you please send me your reproduction repository, so that I can take a look and see what the issue may be? |
@sebastiandg7 here is another repro, which I think follows your steps in accuracy. I still cannot reproduce. Not in Potential solution atm:
But I am not sure I know your issue so I am not sure it will help! |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
@sebastiandg7 once this PR is in a Storybook release, your issue should be fixed! :D |
That's awesome @mandarini! Sorry for nor replying before. Had a problem with my GitHub account and gain access back a couple days ago. You rock 💪🏻 |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
The generated storybook v6 config with Vite as bundler extends the project's
vite.config.ts
with thevite-tsconfig-paths
plugin. The problem is that the specified offset from root for that configuration is calculated relative to the<projectRoot>/.storybook
directory, while the actualvite.config.ts
resides in<projectRoot>/vite.config.ts
making thevite-tsconfig-paths
resolve the workspaceRoot as the Nx workspace parent directory.The behavior above makes storybook fail depending on the content of the Nx workspace parent directory, that's why it works from one scenario to another.
Expected Behavior
The offset from root calculation should be done relative to the project's root containing the
<projectRoot>/.storybook
directory (one..
level less).Like in this example:
GitHub Repo
No response
Steps to Reproduce
playground
playground/foo
with atsconfig.json
that doesn't includebaseUrl
and/orpaths
in thecompilerOptions
.playground
directory:cd /path/to/playground
Nx Report
Failure Logs
Additional Information
No response
The text was updated successfully, but these errors were encountered: