Skip to content

The injection script is attempting to use fileURLToPath from the client #348

@dr-iroh

Description

@dr-iroh

Describe the bug

I'm using @vitejs/devtools@v0.1.23 and manually injecting @vitejs/devtools/client/inject on the client side, and I'm getting this error. My app is SSR-based.

DockStandalone-Y7CEWFPN-BDo6WdN9.js?v=09397d90:301 Uncaught (in promise) TypeError: (0 , import_browser_external_node_url.fileURLToPath) is not a function
at DockStandalone-Y7CEWFPN-BDo6WdN9.js?v=09397d90:301:66

Image

vite.config.ts

export default defineConfig({
  plugins: [
    vue(),
    nitro(),
    DevTools()
  ]
});

main.ts

if (import.meta.hot) {
  import('@vitejs/devtools/client/inject');
}

Reproduction

Shown above

System Info

System:
    OS: Linux 6.11 Ubuntu 24.04.4 LTS 24.04.4 LTS (Noble Numbat)
    CPU: (4) x64 Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz
    Memory: 3.03 GB / 7.68 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 24.15.0 - /home/iroh/.nvm/versions/node/v24.15.0/bin/node
    npm: 11.12.1 - /home/iroh/.nvm/versions/node/v24.15.0/bin/npm
    bun: 1.3.14 - /home/iroh/.bun/bin/bun
  Browsers:
    Chrome: 148.0.7778.167
    Firefox: 150.0.3
    Firefox Developer Edition: 150.0.3

Used Package Manager

bun

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions