storybook: [Bug]: /virtual:/@storybook/builder-vite/setup-addons.js" points to missing source files
Describe the bug
When starting or building Storybook in a Vite project, the following lines are logged to the terminal:
Sourcemap for "/virtual:/@storybook/builder-vite/setup-addons.js" points to missing source files
Sourcemap for "/virtual:/@storybook/builder-vite/vite-app.js" points to missing source files
In Vite 4 projects, even more files might be affected.
Reproduction steps
- Initialize Storybook in a Vite Project
- Start Storybook
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 54
- Comments: 31 (8 by maintainers)
Any update on this?
I use storybook 8.2.7 with a new react (with vite) project and it also appears to me:
+1 storybook v8.2.9, vite + react
Still an issue, v8.2.9
I’m getting the same errors, with Storybook
8.2.7(+ vite):Thanks for sorting this out 🥳
Not yet! I can investigate it next week as part of my empathy week!
I can confirm that with version
8.3.0this issue no more exists.Yes, the fix of the issue was reverted, and it’s still in progress for the next 8.3 : https://github.com/storybookjs/storybook/pull/28867
I also am experiencing:
In addition, HMR is not working. I am on Vite 5.3.5, storybook 8.2.7 (in react).
I was facing the same issue today after upgrading to 8.2.4 Sourcemap for “/virtual:/@storybook/builder-vite/setup-addons.js” points to missing source files Sourcemap for “/virtual:/@storybook/builder-vite/vite-app.js” points to missing source files
So Ive downgraded back to 7.6.20
Tested in 8.3.0-beta.0 and still seeing this issue
I encountered the same logs. Meanwhile I guess downgrading is the fix. Note: Handle storybooks/addons versions for compatibility, I made them match 8.1.11 storybook version.
@David05500 Except of having a nasty warning in the terminal Storybook should still function. I wouldn’t recommend to downgrade just because of it. You could upgrade to 8.1.11. This version is not containing the issue.
Upgraded from
8.0.4to8.2.4today and am now running into this issue.…and so on
@valentinpalkovic believes the docs error I'm facing inside here has no relation to missing source files, so de-emphasizing it here
I am guessing this is what's causing my `parameters.docs.source.transform`'s `code` parameter to be undefined and basically error out with the following in any of my component's docs page:** Disclaimer** This information might be inaccurate, due to it being generated automatically To resolve the issue with missing source files in sourcemaps for
/virtual:/@storybook/builder-vite/setup-addons.jsand/virtual:/@storybook/builder-vite/vite-app.js, follow these steps:vite-config.tsincludes proper handling for source maps.pluginConfighandle source maps correctly.index.ts: Ensure that the Vite server is correctly configured to handle source maps.These changes should ensure that the source maps are correctly generated and point to the correct source files.
References
/code/builders/builder-vite/src/index.ts /code/builders/builder-vite/src/vite-config.ts /code/builders/builder-vite /code/builders
About Greptile
This response provides a starting point for your research, not a precise solution.
Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
Ask Greptile · Edit Issue Bot Settings
I’m experiencing the same issue with Storybook 8.2.9, too.
BTW: I created a sandbox project with the Storybook CLI (
npx storybook@8.2.7 sandbox vue).When I start the storybook instance in this new and clean project, even then I get the following errors:
I can confirm this bug in a Vue + Vite + Storybook project. I just upgraded to Storybook 8.2.7 from Storybook 7.
I have similar issue as @phamhongphuc on Yarn 4 PnP and Storybook Vite 8.2.5. It seems deleting
.yarn.lockfile, deleting the.cachefolder, and reinstalling withyarnresolved the issue. Probably since the lock file still had older vite versions which were missing patches.For the virtual modules, there is forward slash (
/) before:virtual, but the filter regex in vite doesn’t have a pattern to match.Is there a reason why source maps are generated for
@storybookmodules? I believe we can turn off loading source maps, but doesn’t seem to be preventable when modules already have source maps.I can confirm that issue still persist with storybook v8.2.9 and Vite + react.
I downgraded to 8.1.11 but still no meaningful autodocs page (I was already using
vue-component-meta). I can see the component but the controls are still missing. I will open my own bug ticket, because I don’t want to conquer this one here. Thanks anyway for your suggestion to try 8.1 😃This looks more like a different bug.
I don’t see any functional issues even though the warning appears in the terminal.
Has anyone encountered any actual failures anywhere?
My deps now: