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.

Runtimes map to incorrect source files in source maps

See original GitHub issue

🐛 bug report

Currently whenever a runtime asset gets created it maps to the runtime plugin in the sourcemap instead of the actual runtime asset.

The reason I’ve opened this issue is to provide some more context and figure out a proper solution for this as it’ll require some reworking in the core logic of runtimes and/or asset requests

Example:

Screenshot 2020-11-22 at 16 37 15

🤔 Expected Behavior

Should map to the runtime’s generated code.

😯 Current Behavior

Maps to the source code of the runtime plugin

💁 Possible Solution

I’ve got 2 ideas on how to fix this:

  • Allow returning a sourcemap in the runtime plugin or generate one in applyRuntimes, both is currently impossible as AssetRequestInput has no sourcemap value.

  • Implement some layer of virtual fs and create the files virtually.

🔦 Context

Trying to fix the remaining source map bugs

💻 Code Sample

import parcel from 'url:./parcel.webp';

console.log('test');

🌍 Your Environment

Current v2 branch

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
devongovettcommented, Nov 22, 2020

I like the idea of returning a source map from runtimes as part of assetrequestinput. But in most cases the source map should basically be an empty map that’s 1:1 with the code, so maybe in the transformer when AssetRequestInput has a code property it could automatically generate an empty map if none is available?

1reaction
cdllcommented, Dec 16, 2020

this issue is still in v1 version~

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug]: Incorrect sourcemaps in dev #1700 - remix-run ... - GitHub
@remix-run/server-runtime ... Breakpoint won't bound and I think this might happen because of incorrect paths to source files in sourcemaps.
Read more >
What is wrong with SOURCE MAPS and how not to mess with ...
Sourcemaps map not a range of bytes in one file to a range in another, as a naive programmer might think. They only...
Read more >
4 Reasons Why Your Source Maps are Broken - Sentry Blog
Here are four reasons why your source maps are broken and tips on how to fix them. ... Missing or incorrect source map...
Read more >
Should I Use Source Maps in Production? | CSS-Tricks
A “source map” is a special file that connects a minified/uglified version of an asset (CSS or JavaScript) to the original authored version....
Read more >
Map Preprocessed Code to Source Code - Chrome Developers
When running Source Maps in DevTools, you'll notice that the JavaScript isn't compiled and you can see all the individual JavaScript files it ......
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