-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Misaligned source maps #6847
Comments
I inspected the source maps in a visualizer and they seemed right to me, but @bhellema mentioned to me in Slack that it seemed like the source maps got worse (i.e. off by more lines) after each save, which sounds strange. @DeMoorJasper have you ever seen anything like that? |
Not really, it should work after a page refresh, hmr is broken though but that's unfortunately largely a browser issue. Does it still happen after a page refresh? |
Yes, unfortunately after a full refresh, cache clear, we still have difficulty debugging with accurate line numbers. |
I've run into this issue and have had to turn off "Enable JavaScript source maps" in Chrome Debugger Tools -> Settings for now. Debugger Tools also seems unable to get the most recent version of a Parcel build- the source map only shows old versions even if I delete my parcel build dir and rebuild. Disabled source maps is a bit annoying but it gets me to the correct line of code fast, albeit in a large compiled file. |
@johndanek anything you could share about your setup that could help us reproduce? |
@devongovett Unfortunately, I'm not even sure of what details to add. I just tried flipping sourcemaps back on, and the same issue persists. If I add a "debugger" directive, the Chrome debugger will stop at that line, but the debugger is not shown in the source, so off the bat everything is off by one line. |
真难用! I have the same problem. |
I have the same error using Parcel 2 and TS. Minimal repro steps: package.json
.parcelrc
Disabling source maps using On a larger project, the pointer moves 7 lines and the error is not visible in the Sentry. 🤨 |
I have the same problem, and I am using vanilla JavaScript (no typeScript), no .parcelrc, parcel v2 'out of the box'. The misalignment goes away if I turn off "Enable JavaScript source maps" in Chrome Debugger Tools -> Settings, and reappears when I turn it on again. A possible clue is that with 'Enable JavaScript source maps" off, a sample few lines of code looks like this:
and with it on, looks like this:
Note the positions of the |
Same problem with just ES6 and a vanilla parcel install. For me the issue occurs with backtick'ed strings. The more lines between the back ticks, the further off the sourcemap is. const foo = 'foo';
console.log(`
${foo}
`);
//Should be able to set a breakpoint below, but can't. (sadface)
console.log('Hi'); |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
🐛 bug report
When debugging the source, the debugger is not lining up with source maps.
Unfortunately, I don't have much to provide as a sample to help reproduce the issue. I figure I'll log the ticket in case other developers are also experiencing the same issue.
🎛 Configuration (.babelrc, package.json, cli command)
No .babelrc file in our project.
🤔 Expected Behavior
The debugger in chrome should allow you to step through the source code in a logical order.
😯 Current Behavior
The source code doesn't line up with the debugger.
debug-bad-sm.mp4
Here is another capture:

💁 Possible Solution
🤷 - not sure there is one at the current time.
🔦 Context
Just trying to debug the source, preventing us from any effective development.
💻 Code Sample
Of course, this is a private corporate application for which I can't share the source code. However, @devongovett has access if needed.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: