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]: Source code not working . After add source code addons it just displaying loading source... #20475

Open
sfsafsag opened this issue Jan 3, 2023 · 13 comments

Comments

@sfsafsag
Copy link

sfsafsag commented Jan 3, 2023

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"
],

@sfsafsag sfsafsag changed the title [Bug]: [Bug]: Source code not working . After add source code addons it just displaying loading source... Jan 3, 2023
@tfrijsewijk
Copy link

Same here

@tachyon-ops
Copy link

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

@mayank99
Copy link
Contributor

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
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
Copy link
Contributor

mayank99 commented Feb 16, 2023

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
Copy link

lordfpx commented Mar 14, 2023

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

@golonikum
Copy link

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

@Robertorc83
Copy link

I have the same problem with version 7.0.8

@mayerraphael
Copy link

mayerraphael commented Jun 15, 2023

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
Copy link

LuWa-at-work commented Nov 8, 2023

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/[email protected]
├── @storybook/[email protected]
├── @storybook/[email protected]
├── @storybook/[email protected]
├── @storybook/[email protected]
├── @storybook/[email protected]
├── @storybook/[email protected]
├── @storybook/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

@ghost
Copy link

ghost commented Dec 10, 2023

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/[email protected]
├── @storybook/[email protected]
├── @storybook/[email protected]
├── @storybook/[email protected]
├── @storybook/[email protected]
├── @storybook/[email protected]
├── @storybook/[email protected]
├── @storybook/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Same

@pedroapfilho
Copy link

Im also having this issue

@Reaverart
Copy link

Reaverart commented May 31, 2024

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.

@slax57
Copy link

slax57 commented Nov 20, 2024

For anyone, like me, coming to this issue because they have the same problem, but with Storybook v8, you may be interested in the fix I found: #29669
Note: my fix only seems to apply to those using webpack, note vite

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