storybook: build-storybook doesn't load sourcemaps

Describe the bug build-storybook seemingly doesn’t either generate sourcemaps, or load sourcemaps (or both)

To Reproduce Steps to reproduce the behavior:

  1. Run build-storybook
  2. Navigate to the built index.html file and open it in a browser (Chrome ideally)
  3. Go to the “Sources” tab in Chrome
  4. Cmd / Ctrl + P for your original file / component. You won’t be able to find it.
  5. Now run the local server and repeat all the above steps. You should easily be able to find it.

Expected behavior I expect that, since the correct configuration is in place to render sourcemaps (devtool: **'#cheap-module-source-map'**) that it should render.

Screenshots N/A

Code snippets N/A

System:

Environment Info:

  System:
    OS: macOS Mojave 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
  Binaries:
    Node: 10.16.0 - /usr/local/bin/node
    Yarn: 1.19.1 - /usr/local/bin/yarn
    npm: 6.11.3 - /usr/local/bin/npm
  Browsers:
    Chrome: 79.0.3945.130
    Firefox: 67.0.1
    Safari: 12.1.1
  npmPackages:
    @storybook/addon-a11y: ^5.3.3 => 5.3.3 
    @storybook/addon-actions: ^5.3.3 => 5.3.3 
    @storybook/addon-backgrounds: ^5.3.3 => 5.3.3 
    @storybook/addon-centered: ^5.3.3 => 5.3.3 
    @storybook/addon-docs: ^5.3.3 => 5.3.3 
    @storybook/addon-knobs: ^5.3.3 => 5.3.3 
    @storybook/addon-links: ^5.3.3 => 5.3.3 
    @storybook/addons: ^5.3.3 => 5.3.3 
    @storybook/react: ^5.3.3 => 5.3.3 
    @storybook/theming: ^5.3.3 => 5.3.3 

Additional context N/A

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15 (6 by maintainers)

Commits related to this issue

Most upvoted comments

@totszwai you can set a custom devtool in storybook webpack configuration in .storybook/main.js like explained in this guide: https://storybook.js.org/docs/react/configure/webpack

something like:

// .storybook/main.js
module.exports = {
  webpackFinal: async (config, { configType }) => {
    config.devtool = 'inline-source-map'
    return config;
  },
};

@shilman is there something for me to do here?