Skip to content

fetch('/__open-in-editor') in error overlay does not respect base #8627

@ascott18

Description

@ascott18

Describe the bug

  1. Have an app with a base configured.
  2. Introduce an error in your code that triggers the error overlay.
  3. Click a file link in the stack trace. Observe that no editor opens and the response to the request is The server is configured with a public base URL of /myBase/ - did you mean to visit ...

Note that requests to __vite_ping DO prepend base.

Reproduction

NOTE: It doesn't actually reproduce on stackblitz because they seem to have a web worker that intercepts __open_in_editor and does the necessary handling to make it work in that environment. You'll have to download it and run it locally.

https://stackblitz.com/edit/vitejs-vite-gknqnq?file=counter.js,vite.config.ts&terminal=dev

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz 
    Memory: 3.81 GB / 31.94 GB
  Binaries:
    Node: 16.15.1 - C:\Program Files\nodejs\node.EXE       
    Yarn: 1.15.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 102.0.5005.115
    Edge: Spartan (44.19041.1266.0), Chromium (102.0.1245.41)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vite: 2.9.12 => 2.9.12

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions