-
Notifications
You must be signed in to change notification settings - Fork 915
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
Problem with sourcemaps #620
Comments
In my Google Chrome, correct souce mapped. IMO, In the development, I recommend use the Google Chrome due to sophisticate. 😉 |
I'm also having problems with source maps right now, using Webpack 2 + latest vue + vue-loader + Webpack Dev Server... ...I have another app using Webpack 1 and previous vue / vue-loader / webpack-dev-server where I do not have issues (the source maps brings me to the precise Sorry I don't have better information to offer right now. I just did a search for vue-loader/sourcemaps trying to find something... and found this recent GH issue. I tried distinct Webpack configurations for @kazupon - are you using latest webpack-dev-server version, which has been recently released? |
I used the below version.
|
@kazupon I'm using Google Chrome Version 55.0.2883.87 m (64-bit). Did you clone the linked reproduction and tried to see if the problem happens to you too? Maybe my webpack config is missing something. |
Yes, I tried to reproduce your providing repo. |
@kazupon Only one error is being thrown at a time. You must remove the other two to see the one that remains. Could you comment out the 6th line and try again? The error that will be thrown will be the one caused by |
@gustavopch |
It seems it is a Chrome + Webpack issue: webpack/webpack#3165 This explains why it can't be reproduced. The question to make is: which OS and version of Chrome are you using? The issue is so well-know that it is linked from the a highlighted box in the Webpack documentation: https://webpack.js.org/configuration/devtool/ |
Anybody know if this issue is still active? Other threads I've read on webpack repo seem to indicate that 2.3.2 should have fixed some things, but I'm still running into horrendous sourcemap issues on webpack 2.4.1. |
Also having problems with the breakpoints on the latest webpack generated with vue-cli |
Same issues here after upgrading to webpack 2. Breakpoints are only working on some lines. When invoked with the -d option the default type of source maps generated with webpack-dev-server 1.15.1 (used with webpack 1) was As a side note; the default Version:
|
Thanks for that info, I have also found that Cheers guys. |
Maybe related to this https://github.com/Microsoft/vscode-chrome-debug/issues/430 |
@layanto It's not specific to VSCode. I don't use it. |
VSCode is using Chrome debug, so exactly the same as in Chrome. If not working in chrome also will not work in VSCode. The issue in https://github.com/Microsoft/vscode-chrome-debug/issues/430 is because source files in different locations have the same webpack path, so VSCode/Chrome debug can't find the source file. |
@layanto I confirm also something is wrong with generated sourcemaps |
If my original source *.vue file in my project is in lets say: Then the convention for IDE use a chrome remote debugging, expect the source code (original same that is in the IDE) to be in: When using Chrome devtool, we can confirm this is not the case ..the original is in: Because of this breakpoints do not work correctly In Chrome placing breakpoints in: I think the issue is really from vue-loader |
My workaround for breakpoints in IDE is using JS files import in the .vue file ...or stop using .vue files |
@isometriq could you help elaborate your workaround? do you mean using script tag to include the javascript in .vue file? |
i guess he means this
quoted from https://www.reddit.com/r/vuejs/comments/5zjrxe/debugging_vue_in_vscode/ We really need a full blown tutorial of how to set this up.. soon :D |
Thank you for your reply. I will try to see if it works. Definitely something is wrong here with sourcemap. The .vue?5gc file is useless and should not be there. |
For some reason it doenst looks like this tip have been shared here - insert the debugger; (including semicolon ; )
this will allow chrome to show debugging breakpoints ============= |
You are correct @martinandersen3d But used JS files alone with |
@martinandersen3d the issue was with breakpoints in IDE as inside Chrome browser it works already. |
I have tried this, but doesn't work correctly: you need to setup some stuff in the vscode launch.json.. i'll paste mine here with all errors I've made.
other links
|
Yes by IDE i mean this: I can see in the links that I use another IDE: phpstorm. Maybe the |
Ohh.. maybe a little extra tip instead of import/export... you can use
source / read more: page.js
I'm not shure if there is anything i've overlooked? |
Yes, this works, similar to discussed above: It's really when code is inside the |
Some news in newest chrome version if you missed |
Any news on this issue. Its real pain in the ass this ?123 attached to end of vue files. |
Working answer here - Vscode + Vetur.. and a little bit of setup: |
what if I work in phpstorm? |
dont know :( |
My line numbers have always been off in Chrome when using vue-loader. I have tried every devtools option. I have tried with and with , moved to the bottom of *.vue file... just to see what actually offsets the lines. It doesn't help. However, if my *.vue file has a child component written in plain js, that child component has a perfect sourcemap - lines match up to original source. |
apparently i didn't try all combinations. here are my notes on how this works and doesn't:
|
in my project, upgrade babel-core to |
The fundamental issue that I'm still having is that the .vue source maps are not placed in a directory structure which matches their original location: Ideally, the .vue components shown above would be in webpack://app/original/location.vue This would allow debugging from editors such as vscode using chrome remote debugging, as they can then figure out which system files match which source maps. The work around is just using the built in chrome debugger which has been working pretty flawlessly for years in my experience, so this is just a convenience in my case. |
@elijahiuu’s tip works, seems to improve source maps for us 🙇🏻♂️Thanks! |
Glad to tell that @elijahiuu's tip works for me with Laravel project. I tried too several config for webpack.mix.js such as Here is my debug config:
|
Repro: https://github.com/gustavopch/repro-vue-webpack-sourcemaps
Instruction: run
npm run serve
and openlocalhost:8080
.When the error happens inside the
<script>
but outside of the Vue object, the console correctly shows that the error happened atApp.vue:6
.When it happens inside the Vue object (in the
created
method in this case) or in the template, the error in the console doesn't point to App.vue, but to the webpack bundle which is not as readable as the previous case.Am I doing something wrong? I would like all errors to be mapped to the *.vue file, not to the bundle.
The text was updated successfully, but these errors were encountered: