Skip to content
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

File with the same name, chrome debugger breakpoint location is confused #10786

Closed
liningftp opened this issue Dec 1, 2019 · 3 comments · Fixed by #10797
Closed

File with the same name, chrome debugger breakpoint location is confused #10786

liningftp opened this issue Dec 1, 2019 · 3 comments · Fixed by #10797
Labels
Has PR i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: standalone

Comments

@liningftp
Copy link

liningftp commented Dec 1, 2019

Bug Report

Current Behavior
Open Chrome and Turn on F12
Visit http://127.0.0.1/index.html
Breakpoint occurs in ./2/a.js, line2

var b = 2;

But should occurs in ./a.js, line2

debugger

Input Code

./index.html

<!doctype html>
<html lang="en">
    <head>  
      <meta charset="utf-8">
      <title>test</title>
    </head>
    <body>
      <script src="https://unpkg.com/@babel/standalone@7.7.4/babel.min.js"></script>
      <script type="text/babel" src="./a.js"></script>
      <script type="text/babel" src="./2/a.js"></script>
      <script type="text/babel">
      	T();
      </script>
    </body>
</html>

./a.js

function T(){
	debugger;
}

./2/a.js

var a = 1;
var b = 2;
var c = 3;
var d = 4;

Expected behavior/code
Breakpoint occurs in ./a.js

Environment

  • Babel version(s): v7.7.4
  • Node/npm version: Node 13.0.1 /npm 6.12.0
  • OS: Windows 10
  • Browser: Chrome 78.0.3904.108 (64 bit)
  • Monorepo: [e.g. yes/no/Lerna]
  • How you are using Babel: loader
@babel-bot
Copy link
Collaborator

Hey @liningftp! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."

@liningftp
Copy link
Author

liningftp commented Dec 1, 2019

if ./a.js in the after ./2/a.js e.g.

      <script type="text/babel" src="./2/a.js"></script>
      <script type="text/babel" src="./a.js"></script>

debugger is right

@JLHwung
Copy link
Contributor

JLHwung commented Dec 2, 2019

@liningftp Good catch! What happens here is that babel-standalone generates incorrect source maps which confuses Chrome DevTools. It will be fixed in #10797.

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 9, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Has PR i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: standalone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants