Skip to content

Error Middleware import does not respect server.origin or base. #17656

@mkdynamic

Description

@mkdynamic

Describe the bug

The response returned from the error middleware uses a hard coded import to @vite/client, even when server.origin or base config options are set.

Expected behavior would be that the import would include those config options when set.

Reproduction

https://stackblitz.com/edit/vitejs-vite-lp39cj

Steps to reproduce

  1. View the reproduction URL above.
  2. Change the URL to /foo/error
  3. Observe the embedded Vite error overlay import has the incorrect path to the @vite/client

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    vite: ^5.3.2 => 5.3.3

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions