Open rrthomas opened 7 months ago
i also have this problem,Is this problem solved now? I use source-map-support for this, but it doesn't seem to work very well
sourceMapSupport.install({
emptyCacheBetweenOperations: true,
overrideRetrieveFile: true,
retrieveFile: (path) => FunctionCache.get(path)?.compiledCode,
})
Version
v21.7.1
Platform
Linux ecls 6.5.0-25-generic #25~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Feb 20 16:09:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
source_map
What steps will reproduce the bug?
This example is adapted from https://github.com/nodejs/node/issues/43047
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior? Why is that the expected behavior?
The expected behavior is shown if I uncomment the
eval
call infoo.js
and run the code:Now, the traceback shows the error in the CoffeeScript code.
What do you see instead?
Running this code from file
foo.js
gives:Note that the traceback shows the JavaScript source, not the CoffeeScript source.
Additional information
Note that the
vm.Script
module correctly parses thesourceMappingURL
comment, and displays its contents. This led me to believe that the source map would be supported during execution!I'm sorry if I have overlooked other issues in this area; I have only found the issue I referred to above about adding support for source maps to
eval
.