-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Docs - React Typescript - No code available #10179
Comments
You might need to add |
Confirmed solution. Appended
to the Before we close I have one more clarifying question to help others who may end up in a similar situation: Are you saying that by specifying a tsx-loader I am overwriting some out of the box @storybook/source-loader configuration? Thanks a lot for the support. 🙏 |
@jgarplind you're running also, for clarification, it's the addon-docs preset that's configuring source-loader AFAIK. |
@shilman @jgarplind I have the same problem with not showing the This is my config:
|
@elderalves try changing it to: module.exports = {
stories: ['../src/**/*.stories.(jsx|mdx)', '../docs/**/*.stories.(jsx|mdx)'],
addons: [
'@storybook/preset-create-react-app',
'@storybook/addon-actions',
'@storybook/addon-links',
'@storybook/addon-knobs/register',
'@storybook/addon-viewport/register',
'@storybook/addon-storysource/register',
'@storybook/addon-a11y/register',
'@storybook/addon-notes/register',
'@storybook/addon-options/register',
'@storybook/addon-backgrounds/register',
'@storybook/addon-docs', // removed "register"
],
}; If that doesn't work, let me know if you have a repro repo I can look at |
@shilman I changed and it still doesn't show... It's a private repo. for example... my
is it right? |
Thanks, from my side this issue can be closed. |
For anyone facing this problem in general, even without using typescript: In my project I am overriding the default storybook webpack config with my own custom webpack config. This meant that any of the default I re-added the |
Describe the bug
Introducing
@storybook/addon-docs
to my repo, everything in the Docs tab works fine except for the source code which is not available.To Reproduce
Started creating a repro repo using the
cra-ts
gist but got stuck in unrelated issues when ejecting to simulate my own main repo, hence no steps available at this point, please refer to below information.Expected behavior
The source code should be displayed in the Docs tab.
Screenshots
My Docs tab (as you can see just about everything works fine, except for the lack of source code):
Code snippets
main.js
preview.js
webpack.config.js
Alert.stories.tsx
Alert.tsx
System:
Environment Info:
System:
OS: Windows 10 10.0.18362
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Binaries:
Node: 12.16.1 - C:\Program Files\nodejs\node.EXE
npm: 6.14.2 - ~\source\repos\Common-Component-Library\node_modules.bin\npm.CMD
Browsers:
Edge: 44.18362.449.0
Additional context
I've studied similar issues meticulously and tried the suggested fixes, in particular #8104
Worth mentioning is that it doesn't matter if I use CSF or storiesOf, same issue applies.
The text was updated successfully, but these errors were encountered: