Skip to content
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

i can't use window.URL.revokeObjectURL after 0.25.0 #2368

Closed
6 tasks done
JavanShen opened this issue Nov 22, 2022 · 2 comments
Closed
6 tasks done

i can't use window.URL.revokeObjectURL after 0.25.0 #2368

JavanShen opened this issue Nov 22, 2022 · 2 comments

Comments

@JavanShen
Copy link

Describe the bug

i can't use window.URL.revokeObjectURL after 0.25.0, it have error TypeError: window.URL.revokeObjectURL is not a function

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-ylbuyq?file=package.json,test%2Fbasic.test.ts,README.md&initialPath=__vitest__

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (8) x64 Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz
    Memory: 5.22 GB / 15.88 GB
  Binaries:
    Node: 17.4.0 - D:\node\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.3.1 - D:\node\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.819.0), Chromium (107.0.1418.52)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @vitejs/plugin-react: ^2.1.0 => 2.1.0 
    @vitejs/plugin-vue: ^3.1.2 => 3.1.2 
    @vitejs/plugin-vue-jsx: ^2.0.1 => 2.0.1 
    vite: ^3.1.6 => 3.1.6
    vitest: ^0.25.2 => 0.25.2

Used Package Manager

pnpm

Validations

@sheremet-va
Copy link
Member

sheremet-va commented Nov 22, 2022

This is expected behaviour, since jsdom doesn't provide this method: jsdom/jsdom#1721

If you want to revert to Node URL implementation, add this to setupFiles config option:

import { URL } from 'node:url'
globalThis.URL = URL

Related: #1377

@sheremet-va sheremet-va closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2022
@JavanShen
Copy link
Author

This is expected behaviour, since jsdom doesn't provide this method: jsdom/jsdom#1721

If you want to revert to Node URL implementation, add this to setupFiles config option:

import { URL } from 'node:url'
globalThis.URL = URL

Related: #1377

thanks, i solved it

@github-actions github-actions bot locked and limited conversation to collaborators Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants