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

Deno can't handle .JS source map #15940

Closed
lucasavila00 opened this issue Sep 17, 2022 · 1 comment
Closed

Deno can't handle .JS source map #15940

lucasavila00 opened this issue Sep 17, 2022 · 1 comment
Labels
duplicate a duplicate of another issue

Comments

@lucasavila00
Copy link

lucasavila00 commented Sep 17, 2022

The code:

const a = (
  it: [
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string
  ]
) => it;

throw new Error("abc");

Is compiled with tsc --inlineSourceMap main2.ts to:

var a = function (it) { return it; };
throw new Error("abc");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbjIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJtYWluMi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFNLENBQUMsR0FBRyxVQUNSLEVBbUJDLElBQ0UsT0FBQSxFQUFFLEVBQUYsQ0FBRSxDQUFDO0FBRVIsTUFBTSxJQUFJLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQyJ9

It works on node:

$ node --enable-source-maps main2.js
/.../main2.ts:24
throw new Error("abc");
      ^

Error: abc
    at Object.<anonymous> (/.../main2.ts:24:7)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
    at internal/main/run_main_module.js:17:47

But not on Deno:

$ deno --version
deno 1.25.3 (release, x86_64-unknown-linux-gnu)
v8 10.6.194.5
typescript 4.7.4

$deno run main2.js
error: Uncaught Error: abc
Warning Couldn't format source line: Line 24 is out of bounds (source may have changed at runtime)
    at file:///.../main2.js:24:7

I also tested tsc --inlineSourceMap --inlineSources main2.ts, to the same effect.

Would it possible for Deno to handle arbitrary JS source maps? For example, from CoffeeScript?

@kitsonk kitsonk added the duplicate a duplicate of another issue label Sep 17, 2022
@kitsonk
Copy link
Contributor

kitsonk commented Sep 17, 2022

Duplicate of #4499

@kitsonk kitsonk marked this as a duplicate of #4499 Sep 17, 2022
@kitsonk kitsonk closed this as not planned Won't fix, can't repro, duplicate, stale Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants