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

No webpack js source maps in dev mode in version 1.0.7 #2456

Closed
tomjal opened this issue Jun 2, 2017 · 15 comments · Fixed by #2610
Closed

No webpack js source maps in dev mode in version 1.0.7 #2456

tomjal opened this issue Jun 2, 2017 · 15 comments · Fixed by #2610

Comments

@tomjal
Copy link

tomjal commented Jun 2, 2017

I updated to version 1.0.7 and I no longer can debug code in browser. Chrome dev tools only see css files + some files from node_modules, cant see any actual code. What am i doing wrong?

@gaearon
Copy link
Contributor

gaearon commented Jun 2, 2017

Please provide a project reproducing the problem.

@tomjal
Copy link
Author

tomjal commented Jun 2, 2017

@gaearon I cant, its not open source. Well i found the code in browser. Previously (pre 1.0.0) code was under "webpack://" in Chrome Dev Tools, it was structured exactly as folders on disk. Now in 1.0.7 files are there but in "localhost:3000/static/js" and they are mixed in big list with loads of unrelevant files from node_modules different libraries (e.g. babel-runtime, core-js, fbjs.....). Maybe its intended to work that way in webpack 2?

@Timer
Copy link
Contributor

Timer commented Jun 2, 2017

I believe this is related to us turning our sourcemaps into absolute paths.
However, everything is neatly displayed for me:

@tomjal
Copy link
Author

tomjal commented Jun 2, 2017

@Timer hmm im using Windows and NPM 5.0.1. I just created empty "starter" project using Create-react-app 1.0.7 and this is how it looks for me: http://imgur.com/a/lPE1S and http://imgur.com/a/3wmPB while using version 0.9.5: http://imgur.com/a/rLHsH

@Timer
Copy link
Contributor

Timer commented Jun 2, 2017

Hmm; that looks like a chrome bug to me ... maybe they don't check for windows path splits?

@gaearon
Copy link
Contributor

gaearon commented Jun 2, 2017

maybe they don't check for windows path splits?

This is quite possible. Maybe we can just replace them on our side.

@gaearon gaearon added this to the 1.x milestone Jun 2, 2017
@danderson00
Copy link

danderson00 commented Jun 9, 2017

I also just noticed source maps maps are broken for newly created apps too. Interestingly, an existing project that I created a few weeks ago is still working. I've since ejected, but it's using webpack 1.14.0.

It seems version 1.x of react-scripts is now broken in some way. The only way I can find to work around this is to run npm i --save-dev react-scripts@0.9.5 after running create-react-app, which rolls back to webpack 1.14.0.

To reproduce, at least for me, is just to create-react-app test, cd test, npm start, view in Chrome 58.0.3029.110 (64-bit) and only css files appear under the webpack:// folder in dev tools. I have the React Developer Tools extension version 2.3.1 installed. I also just updated Chrome to 59.0.3071.86 (Official Build) (64-bit) and the issue is still present.

@gaearon
Copy link
Contributor

gaearon commented Jun 22, 2017

@danderson00 You did not specify if you are using Windows or not, so it's hard to say anything 😞

I wish people who are upvoting this issue would share more details, as we just don't have enough information about what everybody is seeing. More screenshots would be helpful.

@gaearon
Copy link
Contributor

gaearon commented Jun 22, 2017

For example, it's not clear if source maps don't work or if you just don't find them in webpack:// folder. These sound like different things to me. Can you navigate to a file by pressing Ctrl+O? Do breakpoints work? It's not clear from the reports here.

@pluscubed
Copy link
Contributor

pluscubed commented Jun 23, 2017

Sourcemaps work - when manually searching for a file (Ctrl+O) and setting breakpoints, the correct javascript source is used. It's just that they are not under the webpack:// folder and they list out the full directory addresses without organizing into directories.

@gaearon
Copy link
Contributor

gaearon commented Jun 24, 2017

Makes sense, thanks! Would you like to contribute a fix? I think devtoolModuleFilenameTemplate in Webpack config needs to always be formatted as Unix path.

@gaearon
Copy link
Contributor

gaearon commented Jun 28, 2017

@istana
Copy link

istana commented Jun 30, 2017

I can confirm the fix - I upgraded yarn.lock in my existing create-react-app and source maps works now

romaindso pushed a commit to romaindso/create-react-app that referenced this issue Jul 10, 2017
…ok#2610)

* Fix sourcemap directory organizing on Windows

* Update comments
wmonk referenced this issue in wmonk/create-react-app-typescript Aug 7, 2017
* Fix sourcemap directory organizing on Windows

* Update comments
@mnemanja
Copy link

I'm on 1.0.11 - windows 10.
I've had the same problem and removal of the package-lock.json (npm 5) and reinstalling the node_modules fixed it for me.

morgs32 pushed a commit to BrickworkSoftware/create-react-app that referenced this issue Sep 1, 2017
…ok#2610)

* Fix sourcemap directory organizing on Windows

* Update comments
@ltfschoen
Copy link

I encountered a confusing issue where my source maps didn't load correctly after I renamed say a file a.js to aOld.js, and then created a new file called a.js. It then only showed the old aOld.js in the source maps but not the new a.js file that now existed, and when I ran my code it still called the code in the aOld.js file even though other files were still calling a.js.

@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants