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

Sourcemap support #10

Open
Cobertos opened this issue Mar 15, 2021 · 0 comments
Open

Sourcemap support #10

Cobertos opened this issue Mar 15, 2021 · 0 comments

Comments

@Cobertos
Copy link

Cobertos commented Mar 15, 2021

Looks like this extension doesn't support sourcemaps? It looks to be supported by the upstream.

Here's a small example of it printing the wrong line number for an error.

Using this file (test.js) with some things that will definitely get transpiled:

import dayjs from 'dayjs';

const asdf = ()=>{
  // Just a dummy
  console.log("dummy");
};

const asdy = ()=>{

};

export const a = ()=>{ throw new Error('test'); };

... it will not provide the correct line number for the error when running a():

cobertos@bepis:~/Seafile/projects/COMMISIONED/shopmainstreet/repository$ node
Welcome to Node.js v14.15.4.
Type ".help" for more information.
> const hooks = require('require-extension-hooks')
undefined
> hooks('js').plugin('babel')
Api {
  _extensions: [ [ [Function] ] ],
  _plugin: [Function (anonymous)] { configure: [Function (anonymous)] },
  _include: [],
  _exclude: []
}
> const t = require('./test.js');
undefined
> t.a()
Uncaught Error: test
    at Object.a (/home/cobertos/Seafile/projects/COMMISIONED/shopmainstreet/repository/test.js:20:9)
> 
(To exit, press Ctrl+C again or Ctrl+D or type .exit)
>

Line 20 in test.js:20:9 should be line 12

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