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

build-storybook doesn't load sourcemaps #9901

Closed
rey-wright opened this issue Feb 18, 2020 · 15 comments
Closed

build-storybook doesn't load sourcemaps #9901

rey-wright opened this issue Feb 18, 2020 · 15 comments

Comments

@rey-wright
Copy link

rey-wright commented Feb 18, 2020

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

@rey-wright rey-wright changed the title build-storybook doesn't load sourcemaps build-storybook doesn't load sourcemaps Feb 18, 2020
@shilman
Copy link
Member

shilman commented Feb 19, 2020

cc @ndelangen

@stale
Copy link

stale bot commented Mar 12, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Mar 12, 2020
@DanielHoffmann
Copy link

I can confirm that the default settings are not working properly for sourcemaps, but changing the devtool in the .storybook/webpack.config.js to 'inline-source-map' or ''source-map' works

@stale stale bot removed the inactive label Mar 30, 2020
@shilman
Copy link
Member

shilman commented Apr 1, 2020

@ndelangen do you think we should change this setting per @DanielHoffmann 's comment?

@shilman
Copy link
Member

shilman commented Apr 7, 2020

Ooh-la-la!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-alpha.31 containing PR #10290 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

@tmeasday tmeasday reopened this Jun 26, 2020
@stale
Copy link

stale bot commented Jul 18, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Jul 18, 2020
@stale
Copy link

stale bot commented Aug 22, 2020

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

@stale stale bot closed this as completed Aug 22, 2020
@shilman shilman reopened this Aug 22, 2020
@stale stale bot removed the inactive label Aug 22, 2020
@shilman shilman added the todo label Aug 22, 2020
@github-actions
Copy link
Contributor

Automention: Hey @igor-dv @ndelangen, you've been tagged! Can you give a hand here?

@totszwai
Copy link

@DanielHoffmann where did you add inline-source-map?

@ndelangen
Copy link
Member

@shilman is there something for me to do here?

@totszwai
Copy link

totszwai commented Mar 8, 2022

@ndelangen lol please fix the sourcemaps? XD

@DanielHoffmann
Copy link

@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;
  },
};

@Philzen
Copy link

Philzen commented Apr 1, 2022

@DanielHoffmann i was trying out adding webpackFinal to get around some "sourcemap not found" warning in a RedwoodJS project (which integrates Storybook v6.4.19) but as soon as i add it Storybook won't start anymore. Unsure if this is a redwood setup (which is why i filed it here for now) or if anybody else has experienced this with storybook before.

@WodenWang820118
Copy link

Hi, I still bump into the same issue after using the suggested webpackFinal in the main.js.
Storybook version: 6.5.9
Angular version: 13

Here is my main.js

module.exports = {
  "stories": [
    "../src/**/*.stories.mdx",
    "../src/**/*.stories.@(js|jsx|ts|tsx)"
  ],
  "addons": [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/addon-interactions"
  ],
  "framework": "@storybook/angular",
  "core": {
    "builder": "@storybook/builder-webpack5"
  },
  "features": {
    "babelModeV7": true,
  },
  "webpackFinal": async (config, { configType }) => {
    config.devtool = 'source-map'
    return config;
  },
}

Thanks.

@shilman
Copy link
Member

shilman commented Jun 8, 2023

We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:

@shilman shilman closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2023
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

8 participants