You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you try this in Node.js and/or Deno? That stack trace is horrible, but I wouldn't be surprised if this is more of a Bun issue. It complains about the stackConstructor, which seemingly comes from the standard Error object. Unless the framework is doing some dirty prototype pollution, it's most likely Autometrics assumes some features of the runtime that are not there.
did a little further digging on this. The main problem is that the prepareStackTrace (an interface that we rely on) is V8-only (which is why it works on Node/Deno) meanwhile Bun uses JavaScriptCore. I probably need to revert to using good old manual "stacktrace as string" parsing for these runtimes.
Environment information
and model.ts:
$ bun run --hot src/index.ts
63 | var _a, b;
64 | const defaultPrepareStackTrace = Error.prepareStackTrace;
65 | Error.prepareStackTrace = (, stack2) => stack2;
66 | const { stack: stackConstructor } = new Error();
67 | Error.prepareStackTrace = defaultPrepareStackTrace;
68 | const stack = stackConstructor.map((callSite) => ({
^
TypeError: stackConstructor.map is not a function. (In 'stackConstructor.map((callSite) => ({
name: callSite.getFunctionName(),
file: callSite.getFileName()
}))', 'stackConstructor.map' is undefined)
at getModulePath (/Users/mies/p/am-samples/hono-autometrics/node_modules/@autometrics/autometrics/dist/index.js:68:16)
at autometrics (/Users/mies/p/am-samples/hono-autometrics/node_modules/@autometrics/autometrics/dist/index.js:309:17)
at /Users/mies/p/am-samples/hono-autometrics/src/model.ts:10:24
63 | var _a, b;
64 | const defaultPrepareStackTrace = Error.prepareStackTrace;
65 | Error.prepareStackTrace = (, stack2) => stack2;
66 | const { stack: stackConstructor } = new Error();
67 | Error.prepareStackTrace = defaultPrepareStackTrace;
68 | const stack = stackConstructor.map((callSite) => ({
^
TypeError: stackConstructor.map is not a function. (In 'stackConstructor.map((callSite) => ({
name: callSite.getFunctionName(),
file: callSite.getFileName()
}))', 'stackConstructor.map' is undefined)
at getModulePath (/Users/mies/p/am-samples/hono-autometrics/node_modules/@autometrics/autometrics/dist/index.js:68:16)
at autometrics (/Users/mies/p/am-samples/hono-autometrics/node_modules/@autometrics/autometrics/dist/index.js:309:17)
at /Users/mies/p/am-samples/hono-autometrics/src/model.ts:10:24
The text was updated successfully, but these errors were encountered: