Joshua Wood Web Developer

August 12th, 2021

This is cool, Node.js added an experimental --source-map-support flag in 12.12:

The stack traces were a bit wonky, though—the “->” prefix is not supported by most stack trace parsers (including Honeybadger).

>Error: oops, something went wrong
    at AppService.getHello (/Users/josh/tmp/test-node-app/dist/main.js:100:15)
        -> /Users/josh/tmp/test-node-app/dist/webpack:/test-node-app/src/app.service.ts:6:11
    at AppController.getHello (/Users/josh/tmp/test-node-app/dist/main.js:68:32)
        -> /Users/josh/tmp/test-node-app/dist/webpack:/test-node-app/src/app.controller.ts:10:28
    at /Users/josh/tmp/test-node-app/node_modules/@nestjs/core/router/router-execution-context.js:38:29
    at InterceptorsConsumer.intercept (/Users/josh/tmp/test-node-app/node_modules/@nestjs/core/interceptors/interceptors-consumer.js:11:20)
    at /Users/josh/tmp/test-node-app/node_modules/@nestjs/core/router/router-execution-context.js:46:60
    at /Users/josh/tmp/test-node-app/node_modules/@nestjs/core/router/router-proxy.js:9:23

That’s fixed in Node 14+, so the stack traces are supported everywhere.

>Error: oops, something went wrong
    at AppService.getHello (webpack://test-node-app/src/app.service.ts:6:11)
    at AppController.getHello (webpack://test-node-app/src/app.controller.ts:10:28)
    at /Users/josh/tmp/test-node-app/node_modules/@nestjs/core/router/router-execution-context.js:38:29
    at InterceptorsConsumer.intercept (/Users/josh/tmp/test-node-app/node_modules/@nestjs/core/interceptors/interceptors-consumer.js:11:20)
    at /Users/josh/tmp/test-node-app/node_modules/@nestjs/core/router/router-execution-context.js:46:60
    at /Users/josh/tmp/test-node-app/node_modules/@nestjs/core/router/router-proxy.js:9:23

Node.js projects in Honeybadger can now officially take advantage of source maps, just like Client-Side JavaScript projects can! See my blog post on the Honeybadger Developer Blog