-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Vue 2 - Browser, Firefox and previously chromium, Source Maps are broken #12689
Comments
Is this something that only happened recently (after 2.7 release)? |
Sorry no, this is for version 2.6.11, but has been an issue that began 4 months ago with Chromium going from version 99 to 102 when they release a patch. This just started with Firefox about a week ago starting with version 102. I have noticed a change in how the single file components are viewed in each browser over the past year or so. It use to show one file in the Webpack folder on the source/debugger panel but now it shows multiple copies like Navbar.vue?638c This is an example of what my app shows in the debugger tab for a single file component if Firefox.
Firefox also use to show multiple "versions" but now they just have the one. This is a bit of blind spot for me so I am unsure if I am articulating the issue correctly. |
v2.7.8 is the same, production sourcemap is broken.I used v2.7.8 in vue/cli4, vue/cli5 and vite, sourcemap works fine only in vite. But v2.6.14 is always working fine in vue/cli4 and 5. I didn't try v2.6.14 in vite. Reproduction linkhttps://github.com/Lphal/vue-demo-2.7-cli4 when I click logs in chrome console, it jumps to sourcecode. use v2.6.14: use v2.7.8: I'm wondering if there is something wrong with vue-loader🧐. @yyx990803 |
This issue has been around for a long time and has been asked in Vue CLI and Vue Loader : 这个问题已经很久了,并且在 Vue CLI、 Vue Loader 中都有反馈: To display the Source Map, I configured Webpack as: 为了显示 Source Map,我将 Webpack 配置成了: |
When I am using Vue 2.6.x I was able to debug Vue components, but after migrating to Vue 2.7.9 getting same problem. It makes debugging so hard . Is not there any plan to fix it? |
Hello, is there any update on this? At the moment we have stopped most vue development as it is impossible to debug the vue files in chrome. |
@erhanfirat how did you manage to debug in Vue 2.6.x? I am on 2.6.14 and it doesn't work for me (i use Webstorm), i am using |
@Thomas-1985 it was just working on |
I am also encountering this issue while migrating a large codebase from 2.6 -> 2.7 -> 3, but I dont believe it to be a browser issue. It really seems that the issue is with 2.7. This can be easily reproduced by starting a new vue-cli project (latest), selecting babel+router+vuex+css preprocessors+linting. The only difference between the two projects is pinning vue to |
Sorry for the multiple messages, but I dug a little further and realized something that I think could be helpful. I scaffolded two fresh vue-cli projects, one with just |
@yyx990803 I have tried the solution here and it works on my machine. but there is something wrong with the sourcemap of |
Does this work with [email protected]? I'm having trouble following the solution suggested in vuejs/vue-loader#1657 |
@dgautsch, @darrinmn9 and anyone else still experiencing this issue. I ended up switching to my build step for Vue 2 to Vite. It was fairly straight forward with the only bummer being for a multi page app with server side routing is that every page needs an index.html as entry point. I would be surprised if this ever gets fixed seeing that Vue 2 end of life is this year. It would be a good half step to migrating to Vue 3. Which is my current plan. vite.configs.js
A Little Explanation
Additionally, I used the handle bar plugin to use partials to populate the index.html file for each page in the app. That way I can change it in one place and update all index.html files. index.html
example partial for appbody.hbs
Hope that helps anyone stuck. |
只加lang="ts"其实就会有问题了,同时tsconfig里面sourcemap设置为true可以准确还原script代码,但是无法还原template。 |
@yyx990803 I can still reproduce a sourcemaps issue with |
Source map debugging used to work fine for me on Vue 2, but it suddenly stopped working on Chrome 120. I just verified that by comparing Chrome 119 and 120 debugging in BrowserStack. It makes no difference on Vue 2.6 or 2.7. |
I also encountered this. It is caused by a change to Chrome Dev Tools in 120 that skips scripts from |
Thanks @RobCherry this is what was causing the issue for me |
@RobCherry Thank you so much! |
Version
2.7.7
Reproduction link
github.com
Steps to reproduce
Please use the github repository provided to see a working example. Instructions on how to run app is provided in mark down.
What is expected?
The issue is that webpack's source maps are not working correctly. I should be able to see Vue Single File Component in the debugger tab of Firefox devtools.
What is actually happening?
I am unsure of what the code is that is showing in the debugger tab of the devtools. I am guessing the source mapping is off or something.
This may be a bit confusing because my links are for a Chromium issue that was "fixed", but it is now happening in Firefox. The fix for Chromium was more of a band aid and the real issue lies with Vue and Webpack generating it's source maps and how the browsers handle displaying the source maps.
Please review the Chromium ticket as there is a lot of documentation there regarding this issue.
https://bugs.chromium.org/p/chromium/issues/detail?id=1304217.
Per comment 36 Chromium developer mentions that the fix is "quite arbitrary IMHO. And ideally tools shouldn't generate (and embed) different content under the same URL."
Additionally here is a stack overflow of the issue.
https://stackoverflow.com/questions/71387156/google-chome-99-devtools-source-tab-not-showing-vue-file-code-in-webpack-src-fo/72061160?noredirect=1#comment129028282_72061160
The text was updated successfully, but these errors were encountered: