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

Source maps do not map correctly to TypeScript source files #166

Open
jimmycuadra opened this issue Jan 29, 2022 · 0 comments
Open

Source maps do not map correctly to TypeScript source files #166

jimmycuadra opened this issue Jan 29, 2022 · 0 comments

Comments

@jimmycuadra
Copy link

  • Version: 2.0.5
  • Rollup Version: 2.66.1
  • Operating System and version (if applicable): macOS 11.6.2
  • Node Version (if applicable): 17.3.0
  • Does it work with tsc (if applicable): N/A?

Reproduction

  1. Check out shellwords at commit e1be4b2.
  2. Run yarn install.
  3. Run yarn browser.
  4. Open http://localhost:3000/ in a browser.
  5. Open the developer console and execute the following code: shellwords.split(["text"]).
  6. Note the stack trace shown in the error (first screenshot below).
  7. Open the browser's debugger and look at the source. Note that the lines shown in the stack trace do not correspond to the source code on those lines in the source (second and third screenshots below). This is most easily observed in the third screenshot. The error "string.match" is triggered on line 9, but the stack trace lists line 20, which is a blank line.

Expected Behavior

The line numbers in stack traces should correspond to the correct lines in the TypeScript source code.

Actual Behavior

The line numbers in the stack traces point to different lines in the TypeScript source code.

Screenshots

Stack trace:

source_map_trace

Source code showing line 4, which is reported in the stack trace:

source_map_scan

Source code showing line 20, which is reported in the stack trace:

source_map_split

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant