question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Source maps generation adds broken intermediate code

See original GitHub issue

Version

15.4.1

Reproduction link

https://github.com/NetMatch/vue-loader-testcase

Steps to reproduce

  1. Clone the linked repository
  2. Execute npm ci
  3. Execute npm run build
  4. Inspect the generated source maps in the dist folder

What is expected?

vue-loader generates source maps for the source Vue SFC file and the constituent template, style and script sections.

The appendExtension option is honored and the source map lists the constituents as Example.vue.html, Example.vue.css and Example.vue.js.

What is actually happening?

vue-loader generates source maps for intermediate stages of generated JS code rather than the original sources of the template, style and JS sections.

The appendExtension option is not honored. All generated files are generated under the Example.vue name and are disambiguated by adding part of their content hash as a suffixed query string.


Same issue as in #1163 where the root cause was claimed to be Babel and should have been resolved with latest versions of all build tools. However, the test case presented here uses the latest versions of Webpack and vue-loader and doesn’t even use Babel at all. And still has this problem.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:10
  • Comments:9

github_iconTop GitHub Comments

2reactions
JustAnotherSoftwareDevelopercommented, Apr 19, 2021

Yeah this essentially renders vue unusable. How do you expect people to use an application in production if they can’t debug it? I understand there might be fixes in the cases, but they’re not guaranteed to work and I would expect this to work out of the box

2reactions
ncjonescommented, Mar 6, 2021

What is the status with this issue? Will it ever be addressed? What can I do to help move it along?

It’s very frustrating that Vue template errors can not be mapped to source. When our react native apps have errors in production the Sentry error shows exactly the line in source where the error occurred but for Vue we just get garbage.

I think this is the same issue as https://github.com/vuejs/vue-cli/issues/2978.

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 Reasons Why Your Source Maps are Broken - Sentry Blog
But generating a source map isn't worth diddly if the browser can't ... map that points to an intermediate transformed state of your...
Read more >
Source Maps - Rollbar Docs
Error grouping will be more resilient to code changes. Getting started. To successfully upload source maps, we will walk through the following steps....
Read more >
Grunt concat + uglify with sourcemaps - Stack Overflow
In my case the source maps are generated but unusable. When I set a breakpoint the code does not stop there. Seems like...
Read more >
Should I Use Source Maps in Production? | CSS-Tricks
I agree that sourcemap files should be deployed on production. If one is worried about showing their “real code”, Webpack has a feature...
Read more >
Source Maps - SurviveJS
When your source code has gone through transformations, debugging in the browser becomes a problem. Source maps solve this problem by providing a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found