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

Breakpoints or Source Maps not working properly in Chrome #457

Closed
mindjuice opened this issue Sep 14, 2016 · 13 comments
Closed

Breakpoints or Source Maps not working properly in Chrome #457

mindjuice opened this issue Sep 14, 2016 · 13 comments

Comments

@mindjuice
Copy link

mindjuice commented Sep 14, 2016

I'm using Storybook for some components, but breakpoints are not working correctly in Chrome Dev Tools.

I was able to reproduce the same issue in thekadira-samples/react-storybook-demo app with no modifications (the Todos app sample). Just clone it from github, do npm i and npm run storybook and open your browser to localhost:9001.

If I open TodoItem.js in the Chrome Dev Tools "Source" tab, and put a breakpoint on the first line of render(), then make a change in Storybook that causes a TodoItem to need to re-render (e.g., mark one as complete), the debugger "breaks", but the file that Chrome Dev Tools shows has the name ?d41d, and the contents of the file is just the following:

undefined


/** WEBPACK FOOTER **
 ** 
 **/

Switching over to TodoItem.js has no effect, and single stepping just continues execution.

Anyone else have debugging working in Storybook?

@arunoda arunoda added the bug label Sep 15, 2016
@arunoda
Copy link
Member

arunoda commented Sep 15, 2016

I've also seen this issue.
Would love to work on this.

@jennylia
Copy link

@arunoda Could you please add this feature, it would help me (and others) so much to learn React. <3

@nikhilbaradwaj
Copy link

@nikhilbaradwaj
Copy link

webpack/webpack#2145 has the discussion and temporary fix.

@arunoda
Copy link
Member

arunoda commented Sep 28, 2016

@nikhilbaradwaj Thanks for the reference.

@jennylia
Copy link

@nikhilbaradwaj Thanks but this did not fix the problem of being able to stop on debug points, but not being able to see which javascript line the code is "breaks" on for me. I still see @mindjuice error earlier.

@jennylia
Copy link

@arunoda I changed node_modules/@kadira/storybook/dist/server/webpack.config.js to use devtool: 'inline-source-map' instead of devtool: '#cheap-module-eval-source-map' and this problem was resolved. Technically, I don't like to change config files in node_modules. I think maybe we can do something to the webpack.config file? Changing it in node_module not the best idea, it usually gets gitignored.

@ndelangen
Copy link
Member

If you are still experiencing this issue please re-open 👍

@knaos
Copy link

knaos commented Aug 21, 2018

I am having this issue when developing a react storybook.

@ndelangen
Copy link
Member

What version are you using @knaos ?

@dagatsoin
Copy link

Still an issue on 4.1.6

@markov00
Copy link

markov00 commented Feb 1, 2019

@dagatsoin I'm currently on 4.1.11 and it's just a matter of adding the following on your storybook webpack config:

  config.devtool = 'inline-source-map';

@trianta2
Copy link

Thanks @markov00 , your solution worked for me. For those like me who are still new to storybook, follow this example to update the storybook webpack config.

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