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

v0.34.0 "URL is not defined" failure when using isolate: false #3984

Closed
6 tasks done
EvHaus opened this issue Aug 18, 2023 · 2 comments · Fixed by #4164
Closed
6 tasks done

v0.34.0 "URL is not defined" failure when using isolate: false #3984

EvHaus opened this issue Aug 18, 2023 · 2 comments · Fixed by #4164

Comments

@EvHaus
Copy link
Contributor

EvHaus commented Aug 18, 2023

Describe the bug

After upgrading from vitest version 0.33.0 to 0.34.0 I'm seeing this failure in any tests which rely on the URL global:

ReferenceError: URL is not defined

I'm guessing this is related to the change in:

What's interesting is that my failure only occurs when isolate: false is used. Setting isolate: true makes the problem go away. The error also doesn't happen when focusing on specific tests in watch mode. It only shows up when running my entire test suite.

Rolling back to 0.33.0 fixes the issue.

Reproduction

I haven't been able to reproduce via StackBlitz in a minimal scenario yet, so it's possible it's caused by some interplay between other tests, or perhaps the order in which tests run?

Any advice on what the issue might be? Maybe I can give it another try.

System Info

System:
    OS: macOS 13.4.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 79.16 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.5.1 - ~/.nvm/versions/node/v20.5.1/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.8.0 - ~/.nvm/versions/node/v20.5.1/bin/npm
  Browsers:
    Chrome: 115.0.5790.170
    Chrome Canary: 118.0.5956.0
    Edge: 114.0.1823.55
    Firefox: 116.0.2
    Safari: 16.5.2

Used Package Manager

yarn

Validations

@kjetilod
Copy link

kjetilod commented Sep 8, 2023

I also see this error with Node 18.6.0, but upgrading to 18.17.1 fixes it.

@kjetilod
Copy link

kjetilod commented Sep 8, 2023

I also see this error with Node 18.6.0, but upgrading to 18.17.1 fixes it.

After some more testing, I still get this error on 18.17.1 some times. Seems pretty random from run to run if tests run ok or fail with this error.

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

Successfully merging a pull request may close this issue.

3 participants