-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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: Vitest fails with Failed to cast callsite method 'getFileName' return value
#24869
Comments
Failed to cast callsite method 'getFileName' return value to correct value
Failed to cast callsite method 'getFileName' return value
Related to #23882. |
I was able to narrow this down to a small reproduction snippet. Steps to reproduceRun this script: Error.prepareStackTrace = (err, frames) => {
return frames.map((frame) => frame.getFileName());
};
new Promise((_, reject) => {
reject(new Error("fail").stack);
}).catch((err) => {
console.log(err);
}); Output: error: Uncaught (in promise) TypeError: Failed to cast callsite method 'getFileName' return value to correct value: BadType { actual: "v8::data::Value", expected: "v8::data::String" }.
return frames.map((frame) => frame.getFileName());
^
at file:///Users/marvinh/dev/test/deno-error2/main.ts:2:38
at Array.map (<anonymous>)
at Function.Error.prepareStackTrace (file:///Users/marvinh/dev/test/deno-error2/main.ts:2:17)
at file:///Users/marvinh/dev/test/deno-error2/main.ts:6:28
at new Promise (<anonymous>)
at file:///Users/marvinh/dev/test/deno-error2/main.ts:5:1 Output Node: [
'file:///Users/marvinh/dev/test/deno-error2/foo.mjs',
null,
'file:///Users/marvinh/dev/test/deno-error2/foo.mjs',
'node:internal/modules/esm/module_job',
'node:internal/modules/esm/loader',
'node:internal/modules/run_main'
] It seems like the actual return type of Version: Deno 1.45.5 |
Removing the |
Version: Deno x.x.xCommit hash: 71ca61eThank you for your recent effort to get Vitest working in Deno. After I saw #24825 merged, I tried it against my codebase and ran into the following error:
As I could not make a minimum setup to reproduce the error, I will put some information about the environment instead.
DENO_FUTURE=1 /path/to/deno run -A npm:vitest run
I hope it will be useful to solve the issue. Thank you in advance.
The text was updated successfully, but these errors were encountered: