storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.48k stars 9.29k forks source link

[Bug]: Source code not working . After add source code addons it just displaying loading source... #20475

Open sfsafsag opened 1 year ago

sfsafsag commented 1 year ago

Describe the bug

Source code Screenshot 2023-01-03 111738 not working . After add source code addons it just displaying loading source...

To Reproduce

No response

System

No response

Additional context

"addons": [ "@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions", "@storybook/addon-storysource" ],

tfrijsewijk commented 1 year ago

Same here

tachyon-ops commented 1 year ago

Same ^7.0.0-beta.34 "next": "13.1.5" "typescript": "4.9.4"

mayank99 commented 1 year ago

This can be reproduced in a fresh app / by running the following commands:

npx create-vite@latest storysource-repro
cd storysource-repro
npx storybook@next init
npm i
npm i -D @storybook/addon-storysource # then add it to main.js
npm run storybook
main.js ```js const config = { "stories": [ "../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)" ], "addons": [ "@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions", "@storybook/addon-storysource" ], "framework": { "name": "@storybook/react-vite", "options": {} }, "docs": { "autodocs": "tag" } }; export default config; ```
mayank99 commented 1 year ago

Might have been fixed by #21096.

Edit: tested 7.0.0-beta.48 in a fresh app, it now shows the args instead of "loading source...". So not completely fixed.

lordfpx commented 1 year ago

I'm still using StoryBook 6.5.12 and I've got the same issue.

golonikum commented 1 year ago

I'm using ver. 6.5.16. This issue appears only if I write a story in CSF 3.0 format.

Robertorc83 commented 1 year ago

I have the same problem with version 7.0.8

mayerraphael commented 1 year ago

Same problem with 7.0.20 (framework: preact-webpack5 or react-webpack5). Also happens without the storysource addon.

I only see the Story object, not the rendered jsx. Makes the "show code" part completly useless.

image

LuWa-at-work commented 11 months ago

~Might have been fixed by #21096.~

Edit: tested 7.0.0-beta.48 in a fresh app, it now shows the args instead of "loading source...". So not completely fixed.

Problem still exists with: 😢

├── @storybook/addon-essentials@7.5.3
├── @storybook/addon-interactions@7.5.3
├── @storybook/addon-links@7.5.3
├── @storybook/addon-storysource@7.5.3
├── @storybook/blocks@7.5.3
├── @storybook/testing-library@0.2.2
├── @storybook/vue3-vite@7.5.3
├── @storybook/vue3@7.5.3
├── storybook@7.5.3
├── typescript@5.2.2
├── vite@4.4.11
├── vue@3.3.4
└── vuetify@3.3.23
ghost commented 10 months ago

~Might have been fixed by #21096.~ Edit: tested 7.0.0-beta.48 in a fresh app, it now shows the args instead of "loading source...". So not completely fixed.

Problem still exists with: 😢

├── @storybook/addon-essentials@7.5.3
├── @storybook/addon-interactions@7.5.3
├── @storybook/addon-links@7.5.3
├── @storybook/addon-storysource@7.5.3
├── @storybook/blocks@7.5.3
├── @storybook/testing-library@0.2.2
├── @storybook/vue3-vite@7.5.3
├── @storybook/vue3@7.5.3
├── storybook@7.5.3
├── typescript@5.2.2
├── vite@4.4.11
├── vue@3.3.4
└── vuetify@3.3.23

Same

pedroapfilho commented 8 months ago

Im also having this issue

Reaverart commented 4 months ago

Same issue (storybook 7.6.18) while I tried it debug through node_modules sources I see useParameter("storySource", {}) returns nothing. If I got it right there should be source-loader who provides "storySource" param, it is unclear from docs should I add it manually to main.ts or storybook will do internally somehow. But I also tried to install it additionally and add it like this https://github.com/storybookjs/storybook/blob/next/code/lib/source-loader/README.md#options and it not works.