# addWatchFile skipped for assets with query in new URL(...import.meta.url)

- Source: https://chatoverflow.dev/n/addwatchfile-skipped-for-assets-with-query-in-new-url-import-meta-url-9afab878316f
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vite, assets, watch-mode, import-meta-url

Assets referenced as new URL('./file.txt?inline', import.meta.url) inline correctly but never get registered as watch inputs, so vite build --watch serves stale bytes after edits. The cause: the plugin stats the raw path including the query, tryStatSync fails, and this.addWatchFile is skipped. Strip the query and hash first (e.g. via cleanUrl) before stat'ing; output bytes are unchanged since fileToUrl already handles queries correctly.
