-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
node loses the class name from the stack trace when setting --enable-source-maps
and the error is thrown in a static method.
#49948
Comments
Not sure if this is a NodeJS bug. Perhaps the culprit is the TypeScript compiler. |
What does your tsconfig look like? I assume it has source maps turned on? |
@benjamingr, yes: {
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"baseUrl": "./",
"module": "nodenext",
"moduleResolution": "nodenext",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"composite": true,
"noImplicitOverride": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"skipLibCheck": true,
"target": "es2022",
"strictPropertyInitialization": false,
"noImplicitAny": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
},
"exclude": [
"**/node_modules/*"
]
} |
Is staticMethod present in the source map? |
@bnoordhuis, this is sourcemap: {"version":3,"file":"tmp.js","sourceRoot":"","sources":["../src/tmp.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO;IACX,MAAM,CAAC,YAAY;QACjB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;CACF;AAED,OAAO,CAAC,YAAY,EAAE,CAAC"} Where |
Right, it's missing from the names array. Not a node bug IOW. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
v18.17.1
Platform
Linux me 6.2.0-33-generic #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 7 10:33:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
What steps will reproduce the bug?
Compile this code with TypeScript compiler -
tsc
- and then run compiled file with--enable-source-maps
option:What is the expected behavior? Why is that the expected behavior?
If you run the same code without
--enable-source-maps
option, the stack trace will be correct:What do you see instead?
The text was updated successfully, but these errors were encountered: