evanw / evanw/node-source-map-support

Use sourcemap inside of code executed by eval()

Open
#284 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.2k
Forks
223
PR merge metrics
No merged PRs in 30d

Description

Currently, I use **esbuild** to compile code and dynamically transpile and execute user JS using `eval()`, like this:

```js
try {
if (code) {
code = `(function(exports) {
${code}
return exports;
})({})`
mod = eval(code)
}
} catch (err) {
console.error('Exception:', err)
}
```

The code contains a sourcemap.

Is there a way to use node-source-map-support to print the exception's stack using the sourcemap info?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.