question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not loading - "Loading source..." message

See original GitHub issue

Describe the bug I only see the “loading source…” text in the Storybook tab

.storybooks/webpack.config.js

To Reproduce `module.exports = function({ config }) { config.module.rules.push({ test: /.stories.jsx?$/, loaders: [require.resolve(‘@storybook/addon-storysource/loader’)], enforce: ‘pre’, });

return defaultConfig; };`

addons.js `import ‘@storybook/addon-actions/register’; import ‘@storybook/addon-links/register’; import ‘@storybook/addon-knobs/register’; import ‘storybook-addon-smart-knobs’; import ‘@storybook/addon-storysource/register’;

Folder structure

src /components /stories index.js

`

Expected behavior Expect to see the component code

Screenshots image

image

System:

  • OS: [Linux Mint]
  • Browser: chrome]
  • Framework: [React]

Additional context

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:34 (8 by maintainers)

github_iconTop GitHub Comments

8reactions
MrTimcommented, Oct 25, 2019

Faced the same problem. I made it work with the following setup: .storybook/addons.js

import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
import '@storybook/addon-actions/register';
import '@storybook/addon-storysource/register';

.storybook/webpack.config.js

module.exports = function({ config }) {
    config.module.rules.push(
        {
            test: /\.stories\.js?$/,
            loaders: [require.resolve('@storybook/source-loader')],
            enforce: 'pre'
        }
    )

    return config
}

After that story source finally appeared in the storybook. Maybe this would help someone.

8reactions
j0lv3r4commented, Apr 9, 2019

I was having the same issue and this configuration fixed it for me:

// .storybook/webpack.config.js
const path = require('path');
const storysource = require.resolve('@storybook/addon-storysource/loader')

module.exports = function({ config }) {
  config.module.rules.push({
    test: /\.jsx?$/,
    loaders: [storysource],
    include: path.resolve(__dirname, '../'), // this fixed it, I think.
    enforce: 'pre',
  });

  return config;
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix "Aw, Snap!" page crashes and other page loading errors
If you're getting the "Aw, Snap" error or another error code instead of a webpage, Chrome is having problems loading. You might also...
Read more >
How to Fix the "Messages Failed to Load" Error on Discord for ...
1. Make Sure Discord Isn't Down ... Before you start tweaking any settings, ensure Discord isn't down first. Check the Discord status page...
Read more >
Websites don't load - troubleshoot and fix error messages
First, let's figure out where the problem is · Open a new tab and check to see if you can load another website...
Read more >
Browser console shows DevTools failed to load SourceMap ...
... shows DevTools failed to load SourceMap warning message In Jira ... DevTools failed to load source map: Could not load content for ......
Read more >
"Parser Error Message: Could not load type" in Global.asax
MvcApplication'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="GodsCreationTaxidermy.Core ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found