Skip to content

[BUG?] changing an asset doesn't reload the app using new URL syntax (dev mode) #5334

Closed

Description

@lifaon74

Describe the bug

When running vitejs in dev mode:

If you load an asset using fetch(new URL('./some-image.png, import.meta.url).href), the app is expected to reload when the asset changes. However nothing appends.

function run() {
  const url = new URL('./markdown.md', import.meta.url).href;
  console.log(`reload: ${Date.now()} - ${url}`);
}

run();

https://stackblitz.com/edit/vite-jeafy9?file=main.ts

On my point of view, the app should reload if the imported assets change. It may be useful if we have, for example, a markdown to html preview component. Currently, if we update the .md file, nothing happen.

Reproduction

https://stackblitz.com/edit/vite-jeafy9?file=main.ts

System Info

System:
    OS: Linux 5.4 Zorin OS 15.3
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 1.36 GB / 31.00 GB
    Container: Yes
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 14.9.0 - ~/.nvm/versions/node/v14.9.0/bin/node
    Yarn: 1.22.5 - /usr/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.9.0/bin/npm
  Browsers:
    Firefox: 93.0
  npmPackages:
    vite: ^2.5.7 => 2.5.7

Used Package Manager

yarn

Logs

No response

Validations

Activity

  1. added
    p3-minor-bug
    and removed on Apr 1, 2023
  2. locked and limited conversation to collaborators on Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: hmrp3-minor-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions