souremaps arent being applied
- Dominant language
- TypeScript
- Stars
- 6.8k
- Forks
- 320
- PR merge metrics
- No merged PRs in 30d
Description
Hi - trying to run speedscope to help optimize program startup. It doesn't seem like sourcemaps are being applied, making tracing operations challenging.
Here is a standalone script that closely mimics my setup, illustrating the issue:
test.sh
```sh
set -e
tmpdir=$(mktemp -d)
cat << EOF > $tmpdir/bar.ts
import http from "node:http";
function listenCallBack() {
console.log("Server is running");
setTimeout(() => {
console.log("exiting server...");
process.exit(0);
}, 100);
};
const server = () => {
const server = http.createServer((req, res) => {
res.end("Hello World");
});
server.listen("8080", listenCallBack);
return server;
};
export default server;
EOF
cat << EOF > $tmpdir/index.ts
import('./bar.ts').then((bar) => bar.default());
EOF
cd $tmpdir
npx esbuild --bundle --splitting --minify --sourcemap=linked --platform=node --format=esm --out-extension:.js=.mjs --outdir=./ index.ts
node --prof --enable-source-maps $tmpdir/index.mjs
node --prof-process --preprocess -j isolate*.log | npx speedscope -
rm -rf $tmpdir
```
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.