Skip to content

Custom hosts no longer work in Browser mode #6076

Closed
@cooper667

Description

Describe the bug

: crypto.randomUUID()

This line uses crypto.randomUUID() which is only available in a secure context. Localhost is considered secure, but when using a custom domain (we use one that is just an A record with 127.0.0.1) the page isn't secure without setting up SSL certs, so crypto.randomUUID() isn't available

Reproduction

      api: {
        host: "aDomainThatPointsToLocalhost.com",
      },

then run browser tests as usual, they should fail

System Info

System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M2
    Memory: 219.69 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.1.0 - /usr/local/bin/node
    Yarn: 1.22.21 - /opt/homebrew/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.6.1 - ~/Library/pnpm/pnpm
    bun: 1.0.26 - ~/.bun/bin/bun
  npmPackages:
    @vitest/browser: ^2.0.1 => 2.0.1 
    @vitest/ui: ^2.0.1 => 2.0.1 
    @vitest/utils: ^2.0.1 => 2.0.1 
    vite: ^5.3.3 => 5.3.3 
    vitest: ^2.0.1 => 2.0.1

Used Package Manager

npm

Validations

Metadata

Assignees

Labels

feat: browserIssues and PRs related to the browser runnerp4-importantViolate documented behavior or significantly improves performance (priority)

Type

No type

Projects

  • Status

    P2 - 4

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions