-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Bug: frame.getScriptNameOrSourceURL()
missing on Error
#24898
Labels
bug
Something isn't working correctly
Comments
This issue is just what I am going to create. I ran into the same error when I tested #24869 against my codebase using Vitest. TypeError: frame.getScriptNameOrSourceURL is not a function
❯ wrapCallSite node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite-node/dist/source-map.mjs:800:47
❯ Function.prepareStackTrace node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite-node/dist/source-map.mjs:857:10
❯ processError node_modules/.pnpm/@[email protected]/node_modules/@vitest/utils/dist/error.js:94:11
❯ collectTests node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:784:21
❯ Object.runMicrotasks ext:core/01_core.js:690:26
❯ processTicksAndRejections ext:deno_node/_next_tick.ts:53:10
❯ runNextTicks ext:deno_node/_next_tick.ts:71:3
❯ eventLoopTick ext:core/01_core.js:181:21
❯ startTests node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1179:17
❯ node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vitest/dist/chunks/runBaseTests.CyvqmuC9.js:130:11 // node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite-node/dist/source-map.mjs
function wrapCallSite(frame, state) {
if (state === void 0) {
state = { nextPosition: null, curPosition: null };
}
if (frame.isNative()) {
state.curPosition = null;
return frame;
}
const source = frame.getFileName() || frame.getScriptNameOrSourceURL(); // <- here |
marvinhagemeister
added a commit
to denoland/deno_core
that referenced
this issue
Aug 6, 2024
Both Chrome and Node have a `getScriptNameOrSourceUrl()` method on the `CallSite` prototype. We didn't have that which causes an error in `vitest`, see denoland/deno#24898
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems like we missed one:
.getScriptNameOrSourceURL()
. Interestingly this API is not documented on https://v8.dev/docs/stack-trace-api . This causesvitest
to throw an error.Steps to reproduce
Output Deno:
Output Node:
Output Chrome:
['']
Version: Deno 1.45.5
The text was updated successfully, but these errors were encountered: