Error when renaming a watched `index.ts` file to an `index.tsx` file and vice versa
Related plugins
-
[x] plugin-react
-
[ ] plugin-react-swc
-
[ ] plugin-react-oxc
-
[ ] plugin-rsc
Describe the bug
Vite errors when renaming a watched index.ts file to index.tsx and vice versa
Notes
This happens once vite has seen both the index.ts and index.tsx file, even if they are completely different files. All of the rename sequences below will trigger the bug
index.tsx=>file.tsx, createindex.tsindex.tsx=>file.tsx=>index.tsindex.tsx=>file.tsx,otherFile.ts=>index.ts
I encountered this bug when renaming a component that had the path of Component/index.tsx to Component/Component.tsx, and creating Component/index.ts which re-exported Component/Component.tsx along with some other things.
Reproduction
https://stackblitz.com/edit/vitejs-vite-wcozggna?file=src%2FFoo%2Findex.ts
Steps to reproduce
- run
pnpm dev - notice the import on
src/App.tsx:2is working - edit
src/Foo/index.ts - notice HMR is working
- rename
src/Foo/index.tstosrc/Foo/index.tsx - notice an error in console
- restart the dev server
- notice the import works as expected
System Info
N/A
Used Package Manager
pnpm
Logs
Debug Log
2025-11-20T03:36:06.595Z vite:config config file loaded in 255.21ms
2025-11-20T03:36:06.596Z vite:env loading env files: [
'/home/projects/vitejs-vite-wcozggna/.env',
'/home/projects/vitejs-vite-wcozggna/.env.local',
'/home/projects/vitejs-vite-wcozggna/.env.development',
'/home/projects/vitejs-vite-wcozggna/.env.development.local'
]
2025-11-20T03:36:06.596Z vite:env env files loaded in 0.72ms
2025-11-20T03:36:06.597Z vite:env using resolved env: {}
2025-11-20T03:36:06.603Z vite:config using resolved config: {
plugins: [
'vite:optimized-deps',
'vite:watch-package-data',
'vite:pre-alias',
'alias',
'vite:react-babel',
'vite:react-refresh',
'vite:modulepreload-polyfill',
'vite:resolve',
'vite:html-inline-proxy',
'vite:css',
'vite:esbuild',
'vite:json',
'vite:wasm-helper',
'vite:worker',
'vite:asset',
'vite:react-virtual-preamble',
'vite:wasm-fallback',
'vite:define',
'vite:css-post',
'vite:worker-import-meta-url',
'vite:asset-import-meta-url',
'vite:dynamic-import-vars',
'vite:import-glob',
'vite:client-inject',
'vite:css-analysis',
'vite:import-analysis'
],
server: {
port: 5173,
strictPort: false,
host: undefined,
allowedHosts: [],
https: undefined,
open: false,
proxy: undefined,
cors: {
origin: /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/
},
headers: {},
warmup: { clientFiles: [], ssrFiles: [] },
middlewareMode: false,
fs: {
strict: true,
deny: [ '.env', '.env.*', '*.{crt,pem}', '**/.git/**' ],
allow: [ '/home/projects/vitejs-vite-wcozggna' ]
},
preTransformRequests: true,
perEnvironmentStartEndDuringDev: false,
perEnvironmentWatchChangeDuringDev: false,
sourcemapIgnoreList: [Function: isInNodeModules],
hmr: { overlay: true }
},
esbuild: {
jsxDev: true,
charset: 'utf8',
legalComments: 'none',
jsx: 'automatic',
jsxImportSource: undefined
},
optimizeDeps: {
include: [
'react',
'react-dom',
'react/jsx-dev-runtime',
'react/jsx-runtime'
],
exclude: [],
needsInterop: [],
extensions: [],
disabled: undefined,
holdUntilCrawlEnd: true,
force: false,
noDiscovery: false,
esbuildOptions: { preserveSymlinks: false, jsx: 'automatic' }
},
build: {
target: [ 'chrome107', 'edge107', 'firefox104', 'safari16' ],
polyfillModulePreload: true,
modulePreload: { polyfill: true },
outDir: 'dist',
assetsDir: 'assets',
assetsInlineLimit: 4096,
sourcemap: false,
terserOptions: {},
rollupOptions: { onwarn: [Function: onwarn] },
commonjsOptions: { include: [ /node_modules/ ], extensions: [ '.js', '.cjs' ] },
dynamicImportVarsOptions: { warnOnError: true, exclude: [ /node_modules/ ] },
write: true,
emptyOutDir: null,
copyPublicDir: true,
license: false,
manifest: false,
lib: false,
ssrManifest: false,
ssrEmitAssets: false,
reportCompressedSize: true,
chunkSizeWarningLimit: 500,
watch: null,
cssCodeSplit: true,
minify: 'esbuild',
ssr: false,
emitAssets: false,
createEnvironment: [Function: createEnvironment],
cssTarget: [ 'chrome107', 'edge107', 'firefox104', 'safari16' ],
cssMinify: true
},
environments: {
client: {
define: undefined,
resolve: {
externalConditions: [ 'node', 'module-sync' ],
extensions: [
'.mjs', '.js',
'.mts', '.ts',
'.jsx', '.tsx',
'.json'
],
dedupe: [],
noExternal: [],
external: [],
preserveSymlinks: false,
alias: [
{
find: /^\/?@vite\/env/,
replacement: '/@fs/home/projects/vitejs-vite-wcozggna/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/env.mjs'
},
{
find: /^\/?@vite\/client/,
replacement: '/@fs/home/projects/vitejs-vite-wcozggna/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/client.mjs'
}
],
mainFields: [ 'browser', 'module', 'jsnext:main', 'jsnext' ],
conditions: [ 'module', 'browser', 'development|production' ],
builtins: []
},
keepProcessEnv: false,
consumer: 'client',
optimizeDeps: {
include: [
'react',
'react-dom',
'react/jsx-dev-runtime',
'react/jsx-runtime'
],
exclude: [],
needsInterop: [],
extensions: [],
disabled: undefined,
holdUntilCrawlEnd: true,
force: false,
noDiscovery: false,
esbuildOptions: { preserveSymlinks: false, jsx: 'automatic' }
},
dev: {
warmup: [],
sourcemap: { js: true },
sourcemapIgnoreList: [Function: isInNodeModules],
preTransformRequests: true,
createEnvironment: [Function: defaultCreateClientDevEnvironment],
recoverable: true,
moduleRunnerTransform: false
},
build: {
target: [ 'chrome107', 'edge107', 'firefox104', 'safari16' ],
polyfillModulePreload: true,
modulePreload: { polyfill: true },
outDir: 'dist',
assetsDir: 'assets',
assetsInlineLimit: 4096,
sourcemap: false,
terserOptions: {},
rollupOptions: { onwarn: [Function: onwarn] },
commonjsOptions: { include: [ /node_modules/ ], extensions: [ '.js', '.cjs' ] },
dynamicImportVarsOptions: { warnOnError: true, exclude: [ /node_modules/ ] },
write: true,
emptyOutDir: null,
copyPublicDir: true,
license: false,
manifest: false,
lib: false,
ssrManifest: false,
ssrEmitAssets: false,
reportCompressedSize: true,
chunkSizeWarningLimit: 500,
watch: null,
cssCodeSplit: true,
minify: 'esbuild',
ssr: false,
emitAssets: true,
createEnvironment: [Function: createEnvironment],
cssTarget: [ 'chrome107', 'edge107', 'firefox104', 'safari16' ],
cssMinify: true
},
plugins: [
{
name: 'vite:optimized-deps',
applyToEnvironment: [Function: applyToEnvironment],
resolveId: [Function: resolveId],
load: [AsyncFunction: load]
},
{
name: 'vite:watch-package-data',
buildStart: [Function: buildStart],
buildEnd: [Function: buildEnd],
watchChange: [Function: watchChange]
},
{
name: 'vite:pre-alias',
applyToEnvironment: [Function: applyToEnvironment],
resolveId: [AsyncFunction: resolveId]
},
{
name: 'alias',
buildStart: [AsyncFunction: buildStart],
resolveId: [Function: resolveId]
},
{
name: 'vite:react-babel',
enforce: 'pre',
config: [Function: config],
configResolved: [Function: configResolved],
options: [Function: options],
transform: {
filter: {
id: {
include: /\.[tj]sx?(?:\?.*)?$/,
exclude: /\/node_modules\//
}
},
handler: [AsyncFunction: handler]
}
},
{
name: 'vite:react-refresh',
enforce: 'pre',
config: [Function: config],
resolveId: {
filter: { id: /^\/@react\-refresh$/ },
handler: [Function: handler]
},
load: {
filter: { id: /^\/@react\-refresh$/ },
handler: [Function: handler]
},
transformIndexHtml: [Function: transformIndexHtml]
},
{
name: 'vite:modulepreload-polyfill',
resolveId: {
filter: { id: /^vite\/modulepreload\-polyfill$/ },
handler: [Function: handler]
},
load: {
filter: { id: /^�vite\/modulepreload\-polyfill\.js$/ },
handler: [Function: handler]
}
},
{
name: 'vite:resolve',
resolveId: {
filter: { id: { exclude: /^(?:\0|\/?virtual:)/ } },
handler: [AsyncFunction: handler]
},
load: {
filter: {
id: [
/^__vite\-browser\-external/,
/^__vite\-optional\-peer\-dep/
]
},
handler: [Function: handler]
}
},
{
name: 'vite:html-inline-proxy',
resolveId: {
filter: { id: /[?&]html-proxy\b/ },
handler: [Function: handler]
},
load: {
filter: { id: /[?&]html-proxy\b/ },
handler: [Function: handler]
}
},
{
name: 'vite:css',
buildStart: [Function: buildStart],
buildEnd: [Function: buildEnd],
load: {
filter: {
id: /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/
},
handler: [AsyncFunction: handler]
},
transform: {
filter: {
id: {
include: /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/,
exclude: [
/[?&]commonjs-proxy/,
/[?&](?:worker|sharedworker|raw|url)\b/
]
}
},
handler: [AsyncFunction: handler]
}
},
{
name: 'vite:esbuild',
configureServer: [Function: configureServer],
transform: [AsyncFunction: transform]
},
{
name: 'vite:json',
transform: {
filter: {
id: {
include: /\.json(?:$|\?)(?!commonjs-(?:proxy|external))/,
exclude: /[?&](?:worker|sharedworker|raw|url)\b/
}
},
handler: [Function: handler]
}
},
{
name: 'vite:wasm-helper',
resolveId: {
filter: { id: /^�vite\/wasm\-helper\.js$/ },
handler: [Function: handler]
},
load: {
filter: {
id: [
/^�vite\/wasm\-helper\.js$/,
/(?<![?#].*)\.wasm\?init/
]
},
handler: [AsyncFunction: handler]
}
},
{
name: 'vite:worker',
buildStart: [Function: buildStart],
load: {
filter: { id: /(?:\?|&)(worker|sharedworker)(?:&|$)/ },
handler: [AsyncFunction: handler]
},
transform: {
filter: { id: /(?:\?|&)worker_file&type=(\w+)(?:&|$)/ },
handler: [AsyncFunction: handler]
},
renderChunk: [Function: renderChunk],
generateBundle: [Function: generateBundle],
watchChange: [Function: watchChange]
},
{
name: 'vite:asset',
perEnvironmentStartEndDuringDev: true,
buildStart: [Function: buildStart],
resolveId: { handler: [Function: handler] },
load: {
filter: { id: { exclude: /^\0/ } },
handler: [AsyncFunction: handler]
},
renderChunk: [Function: renderChunk],
generateBundle: [Function: generateBundle]
},
{
name: 'vite:react-virtual-preamble',
resolveId: {
order: 'pre',
filter: { id: /^@vitejs\/plugin\-react\/preamble$/ },
handler: [Function: handler]
},
load: {
filter: { id: /^�@vitejs\/plugin\-react\/preamble$/ },
handler: [Function: handler]
}
},
{
name: 'vite:wasm-fallback',
load: { filter: { id: /\.wasm$/ }, handler: [Function: handler] }
},
{
name: 'vite:define',
transform: { handler: [AsyncFunction: handler] }
},
{
name: 'vite:css-post',
renderStart: [Function: renderStart],
transform: {
filter: {
id: {
include: /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/,
exclude: [
/[?&]commonjs-proxy/,
/[?&](?:worker|sharedworker|raw|url)\b/
]
}
},
handler: [AsyncFunction: handler]
},
renderChunk: [AsyncFunction: renderChunk],
augmentChunkHash: [Function: augmentChunkHash],
generateBundle: [AsyncFunction: generateBundle]
},
{
name: 'vite:worker-import-meta-url',
applyToEnvironment: [Function: applyToEnvironment],
transform: {
filter: {
code: /new\s+(?:Worker|SharedWorker)\s*\(\s*new\s+URL.+?import\.meta\.url/s
},
handler: [AsyncFunction: handler]
}
},
{
name: 'vite:asset-import-meta-url',
applyToEnvironment: [Function: applyToEnvironment],
transform: {
filter: {
id: {
exclude: [
/^�vite\/preload\-helper\.js$/,
/^\/home\/projects\/vitejs\-vite\-wcozggna\/node_modules\/\.pnpm\/vite@7\.2\.2_@types\+node@24\.10\.1\/node_modules\/vite\/dist\/client\/client\.mjs$/
]
},
code: /new\s+URL.+import\.meta\.url/s
},
handler: [AsyncFunction: handler]
}
},
{
name: 'vite:dynamic-import-vars',
resolveId: {
filter: { id: /^�vite\/dynamic\-import\-helper\.js$/ },
handler: [Function: handler]
},
load: {
filter: { id: /^�vite\/dynamic\-import\-helper\.js$/ },
handler: [Function: handler]
},
transform: {
filter: {
id: {
exclude: /^\/home\/projects\/vitejs\-vite\-wcozggna\/node_modules\/\.pnpm\/vite@7\.2\.2_@types\+node@24\.10\.1\/node_modules\/vite\/dist\/client\/client\.mjs$/
},
code: /\bimport\s*[(/]/
},
handler: [AsyncFunction: handler]
}
},
{
name: 'vite:import-glob',
buildStart: [Function: buildStart],
transform: {
filter: { code: 'import.meta.glob' },
handler: [AsyncFunction: handler]
},
hotUpdate: [Function: hotUpdate]
},
{
name: 'vite:client-inject',
buildStart: [AsyncFunction: buildStart],
transform: [AsyncFunction: transform]
},
{
name: 'vite:css-analysis',
transform: {
filter: {
id: {
include: /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/,
exclude: [
/[?&]commonjs-proxy/,
/[?&](?:worker|sharedworker|raw|url)\b/
]
}
},
handler: [AsyncFunction: handler]
}
},
{
name: 'vite:import-analysis',
transform: [AsyncFunction: transform]
}
]
},
ssr: {
define: undefined,
resolve: {
externalConditions: [ 'node', 'module-sync' ],
extensions: [
'.mjs', '.js',
'.mts', '.ts',
'.jsx', '.tsx',
'.json'
],
dedupe: [],
noExternal: [],
external: [],
preserveSymlinks: false,
alias: [
{
find: /^\/?@vite\/env/,
replacement: '/@fs/home/projects/vitejs-vite-wcozggna/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/env.mjs'
},
{
find: /^\/?@vite\/client/,
replacement: '/@fs/home/projects/vitejs-vite-wcozggna/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/client.mjs'
}
],
mainFields: [ 'module', 'jsnext:main', 'jsnext' ],
conditions: [ 'module', 'node', 'development|production' ],
builtins: [
'_http_agent',
'_http_client',
'_http_common',
'_http_incoming',
'_http_outgoing',
'_http_server',
'_stream_duplex',
'_stream_passthrough',
'_stream_readable',
'_stream_transform',
'_stream_wrap',
'_stream_writable',
'_tls_common',
'_tls_wrap',
'assert',
'async_hooks',
'buffer',
'child_process',
'cluster',
'console',
'constants',
'crypto',
'dgram',
'diagnostics_channel',
'dns',
'domain',
'events',
'fs',
'http',
'http2',
'https',
'inspector',
'module',
'net',
'os',
'path',
'perf_hooks',
'process',
'punycode',
'querystring',
'readline',
'repl',
'stream',
'string_decoder',
'sys',
'timers',
'tls',
'trace_events',
'tty',
'url',
'util',
'v8',
'vm',
'wasi',
'worker_threads',
'zlib',
'util/types',
'timers/promises',
'stream/consumers',
'stream/promises',
'stream/web',
'readline/promises',
'path/posix',
'path/win32',
'inspector/promises',
'fs/promises',
'dns/promises',
'assert/strict',
'@blitz/internal/kernel',
'@blitz/internal/platform-browser',
'@blitz/internal/native',
'@blitz/internal/comlink',
'@blitz/internal/git',
'@blitz/internal/message-port',
'@blitz/internal/pty',
'@blitz/internal/env',
'@blitz/env',
'@blitz/pty',
'@blitz/kernel',
'@blitz/platform-browser',
'@blitz/message-port',
/^node:/,
/^bun:/
]
},
keepProcessEnv: true,
consumer: 'server',
optimizeDeps: {
include: [],
exclude: [],
needsInterop: [],
extensions: [],
disabled: undefined,
holdUntilCrawlEnd: true,
force: false,
noDiscovery: true,
esbuildOptions: { preserveSymlinks: false }
},
dev: {
warmup: [],
sourcemap: { js: true },
sourcemapIgnoreList: [Function: isInNodeModules],
preTransformRequests: false,
createEnvironment: [Function: defaultCreateDevEnvironment],
recoverable: false,
moduleRunnerTransform: true
},
build: {
target: [ 'chrome107', 'edge107', 'firefox104', 'safari16' ],
polyfillModulePreload: true,
modulePreload: { polyfill: true },
outDir: 'dist',
assetsDir: 'assets',
assetsInlineLimit: 4096,
sourcemap: false,
terserOptions: {},
rollupOptions: { onwarn: [Function: onwarn] },
commonjsOptions: { include: [ /node_modules/ ], extensions: [ '.js', '.cjs' ] },
dynamicImportVarsOptions: { warnOnError: true, exclude: [ /node_modules/ ] },
write: true,
emptyOutDir: null,
copyPublicDir: true,
license: false,
manifest: false,
lib: false,
ssrManifest: false,
ssrEmitAssets: false,
reportCompressedSize: true,
chunkSizeWarningLimit: 500,
watch: null,
cssCodeSplit: true,
minify: false,
ssr: true,
emitAssets: false,
createEnvironment: [Function: createEnvironment],
cssTarget: [ 'chrome107', 'edge107', 'firefox104', 'safari16' ],
cssMinify: 'esbuild'
},
plugins: [
{
name: 'vite:watch-package-data',
buildStart: [Function: buildStart],
buildEnd: [Function: buildEnd],
watchChange: [Function: watchChange]
},
{
name: 'alias',
buildStart: [AsyncFunction: buildStart],
resolveId: [Function: resolveId]
},
{
name: 'vite:react-babel',
enforce: 'pre',
config: [Function: config],
configResolved: [Function: configResolved],
options: [Function: options],
transform: {
filter: {
id: {
include: /\.[tj]sx?(?:\?.*)?$/,
exclude: /\/node_modules\//
}
},
handler: [AsyncFunction: handler]
}
},
{
name: 'vite:react-refresh',
enforce: 'pre',
config: [Function: config],
resolveId: {
filter: { id: /^\/@react\-refresh$/ },
handler: [Function: handler]
},
load: {
filter: { id: /^\/@react\-refresh$/ },
handler: [Function: handler]
},
transformIndexHtml: [Function: transformIndexHtml]
},
{
name: 'vite:modulepreload-polyfill',
resolveId: {
filter: { id: /^vite\/modulepreload\-polyfill$/ },
handler: [Function: handler]
},
load: {
filter: { id: /^�vite\/modulepreload\-polyfill\.js$/ },
handler: [Function: handler]
}
},
{
name: 'vite:resolve',
resolveId: {
filter: { id: { exclude: /^(?:\0|\/?virtual:)/ } },
handler: [AsyncFunction: handler]
},
load: {
filter: {
id: [
/^__vite\-browser\-external/,
/^__vite\-optional\-peer\-dep/
]
},
handler: [Function: handler]
}
},
{
name: 'vite:html-inline-proxy',
resolveId: {
filter: { id: /[?&]html-proxy\b/ },
handler: [Function: handler]
},
load: {
filter: { id: /[?&]html-proxy\b/ },
handler: [Function: handler]
}
},
{
name: 'vite:css',
buildStart: [Function: buildStart],
buildEnd: [Function: buildEnd],
load: {
filter: {
id: /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/
},
handler: [AsyncFunction: handler]
},
transform: {
filter: {
id: {
include: /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/,
exclude: [
/[?&]commonjs-proxy/,
/[?&](?:worker|sharedworker|raw|url)\b/
]
}
},
handler: [AsyncFunction: handler]
}
},
{
name: 'vite:esbuild',
configureServer: [Function: configureServer],
transform: [AsyncFunction: transform]
},
{
name: 'vite:json',
transform: {
filter: {
id: {
include: /\.json(?:$|\?)(?!commonjs-(?:proxy|external))/,
exclude: /[?&](?:worker|sharedworker|raw|url)\b/
}
},
handler: [Function: handler]
}
},
{
name: 'vite:wasm-helper',
resolveId: {
filter: { id: /^�vite\/wasm\-helper\.js$/ },
handler: [Function: handler]
},
load: {
filter: {
id: [
/^�vite\/wasm\-helper\.js$/,
/(?<![?#].*)\.wasm\?init/
]
},
handler: [AsyncFunction: handler]
}
},
{
name: 'vite:worker',
buildStart: [Function: buildStart],
load: {
filter: { id: /(?:\?|&)(worker|sharedworker)(?:&|$)/ },
handler: [AsyncFunction: handler]
},
transform: {
filter: { id: /(?:\?|&)worker_file&type=(\w+)(?:&|$)/ },
handler: [AsyncFunction: handler]
},
renderChunk: [Function: renderChunk],
generateBundle: [Function: generateBundle],
watchChange: [Function: watchChange]
},
{
name: 'vite:asset',
perEnvironmentStartEndDuringDev: true,
buildStart: [Function: buildStart],
resolveId: { handler: [Function: handler] },
load: {
filter: { id: { exclude: /^\0/ } },
handler: [AsyncFunction: handler]
},
renderChunk: [Function: renderChunk],
generateBundle: [Function: generateBundle]
},
{
name: 'vite:react-virtual-preamble',
resolveId: {
order: 'pre',
filter: { id: /^@vitejs\/plugin\-react\/preamble$/ },
handler: [Function: handler]
},
load: {
filter: { id: /^�@vitejs\/plugin\-react\/preamble$/ },
handler: [Function: handler]
}
},
{
name: 'vite:wasm-fallback',
load: { filter: { id: /\.wasm$/ }, handler: [Function: handler] }
},
{
name: 'vite:define',
transform: { handler: [AsyncFunction: handler] }
},
{
name: 'vite:css-post',
renderStart: [Function: renderStart],
transform: {
filter: {
id: {
include: /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/,
exclude: [
/[?&]commonjs-proxy/,
/[?&](?:worker|sharedworker|raw|url)\b/
]
}
},
handler: [AsyncFunction: handler]
},
renderChunk: [AsyncFunction: renderChunk],
augmentChunkHash: [Function: augmentChunkHash],
generateBundle: [AsyncFunction: generateBundle]
},
{
name: 'vite:dynamic-import-vars',
resolveId: {
filter: { id: /^�vite\/dynamic\-import\-helper\.js$/ },
handler: [Function: handler]
},
load: {
filter: { id: /^�vite\/dynamic\-import\-helper\.js$/ },
handler: [Function: handler]
},
transform: {
filter: {
id: {
exclude: /^\/home\/projects\/vitejs\-vite\-wcozggna\/node_modules\/\.pnpm\/vite@7\.2\.2_@types\+node@24\.10\.1\/node_modules\/vite\/dist\/client\/client\.mjs$/
},
code: /\bimport\s*[(/]/
},
handler: [AsyncFunction: handler]
}
},
{
name: 'vite:import-glob',
buildStart: [Function: buildStart],
transform: {
filter: { code: 'import.meta.glob' },
handler: [AsyncFunction: handler]
},
hotUpdate: [Function: hotUpdate]
},
{
name: 'vite:client-inject',
buildStart: [AsyncFunction: buildStart],
transform: [AsyncFunction: transform]
},
{
name: 'vite:css-analysis',
transform: {
filter: {
id: {
include: /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/,
exclude: [
/[?&]commonjs-proxy/,
/[?&](?:worker|sharedworker|raw|url)\b/
]
}
},
handler: [AsyncFunction: handler]
}
},
{
name: 'vite:import-analysis',
transform: [AsyncFunction: transform]
}
]
}
},
resolve: {
externalConditions: [ 'node', 'module-sync' ],
extensions: [
'.mjs', '.js',
'.mts', '.ts',
'.jsx', '.tsx',
'.json'
],
dedupe: [],
noExternal: [],
external: [],
preserveSymlinks: false,
alias: [
{
find: /^\/?@vite\/env/,
replacement: '/@fs/home/projects/vitejs-vite-wcozggna/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/env.mjs'
},
{
find: /^\/?@vite\/client/,
replacement: '/@fs/home/projects/vitejs-vite-wcozggna/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/client.mjs'
}
],
mainFields: [ 'browser', 'module', 'jsnext:main', 'jsnext' ],
conditions: [ 'module', 'browser', 'development|production' ],
builtins: []
},
configFile: '/home/projects/vitejs-vite-wcozggna/vite.config.ts',
configFileDependencies: [ '/home/projects/vitejs-vite-wcozggna/vite.config.ts' ],
inlineConfig: {
root: undefined,
base: undefined,
mode: undefined,
configFile: undefined,
configLoader: undefined,
logLevel: undefined,
clearScreen: undefined,
server: { host: undefined },
forceOptimizeDeps: undefined
},
root: '/home/projects/vitejs-vite-wcozggna',
base: '/',
decodedBase: '/',
rawBase: '/',
publicDir: '/home/projects/vitejs-vite-wcozggna/public',
cacheDir: '/home/projects/vitejs-vite-wcozggna/node_modules/.vite',
command: 'serve',
mode: 'development',
isWorker: false,
mainConfig: null,
bundleChain: [],
isProduction: false,
css: {
transformer: 'postcss',
preprocessorMaxWorkers: true,
devSourcemap: false
},
json: { namedExports: true, stringify: 'auto' },
builder: undefined,
preview: {
port: 4173,
strictPort: false,
host: undefined,
allowedHosts: [],
https: undefined,
open: false,
proxy: undefined,
cors: {
origin: /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/
},
headers: {}
},
envDir: '/home/projects/vitejs-vite-wcozggna',
env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false },
assetsInclude: [Function: assetsInclude],
logger: {
hasWarned: false,
info: [Function: info],
warn: [Function: warn],
warnOnce: [Function: warnOnce],
error: [Function: error],
clearScreen: [Function: clearScreen],
hasErrorLogged: [Function: hasErrorLogged]
},
packageCache: Map(1) {
'fnpd_/home/projects/vitejs-vite-wcozggna' => {
dir: '/home/projects/vitejs-vite-wcozggna',
data: {
name: 'vite-react-typescript-starter',
private: true,
version: '0.0.0',
type: 'module',
scripts: {
clean: 'rm -rf dist && rm -rf node_modules && pnpm i',
dev: 'pnpm clean && vite',
build: 'pnpm clean && vite build'
},
dependencies: { react: '^19.2.0', 'react-dom': '^19.2.0' },
devDependencies: {
'@eslint/js': '^9.39.1',
'@types/node': '^24.10.1',
'@types/react': '^19.2.5',
'@types/react-dom': '^19.2.3',
'@vitejs/plugin-react': '^5.1.1',
eslint: '^9.39.1',
'eslint-plugin-react-hooks': '^7.0.1',
'eslint-plugin-react-refresh': '^0.4.24',
globals: '^16.5.0',
typescript: '~5.9.3',
'typescript-eslint': '^8.46.4',
vite: '^7.2.2'
}
},
hasSideEffects: [Function: hasSideEffects],
setResolvedCache: [Function: setResolvedCache],
getResolvedCache: [Function: getResolvedCache]
},
set: [Function (anonymous)]
},
worker: { format: 'iife', plugins: '() => plugins', rollupOptions: {} },
appType: 'spa',
experimental: {
importGlobRestoreExtension: false,
renderBuiltUrl: undefined,
hmrPartialAccept: false
},
future: undefined,
ssr: {
target: 'node',
optimizeDeps: {
esbuildOptions: { preserveSymlinks: false },
include: [],
exclude: [],
needsInterop: [],
extensions: [],
holdUntilCrawlEnd: true,
force: false,
noDiscovery: true
},
external: [],
noExternal: [],
resolve: {
conditions: [ 'module', 'node', 'development|production' ],
externalConditions: [ 'node', 'module-sync' ]
}
},
dev: {
warmup: [],
sourcemap: { js: true },
sourcemapIgnoreList: [Function: isInNodeModules],
preTransformRequests: false,
createEnvironment: [Function: defaultCreateDevEnvironment],
recoverable: false,
moduleRunnerTransform: false
},
webSocketToken: 'HGenpr8zOlEU',
getSortedPlugins: [Function: getSortedPlugins],
getSortedPluginHooks: [Function: getSortedPluginHooks],
createResolver: [Function: createResolver],
fsDenyGlob: [Function: arrayMatcher],
safeModulePaths: Set(0) {},
[Symbol(vite:resolved-config)]: true
}
2025-11-20T03:36:06.619Z vite:deps (client) Hash is consistent. Skipping. Use --force to override.
VITE v7.2.2 ready in 884 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help
2025-11-20T03:36:06.629Z vite:html-fallback Rewriting GET / to /index.html
2025-11-20T03:36:06.632Z vite:hmr [file change] debug.log
2025-11-20T03:36:06.633Z vite:hmr (client) [no modules matched] debug.log
2025-11-20T03:36:06.633Z vite:hmr (ssr) [no modules matched] debug.log
2025-11-20T03:36:06.730Z vite:time 101.31ms /index.html
2025-11-20T03:36:06.733Z vite:resolve 6.63ms /src/main.tsx -> /home/projects/vitejs-vite-wcozggna/src/main.tsx
2025-11-20T03:36:06.741Z vite:load 6.90ms [fs] /src/main.tsx
2025-11-20T03:36:06.746Z vite:hmr [file change] debug.log
2025-11-20T03:36:06.746Z vite:hmr (client) [no modules matched] debug.log
2025-11-20T03:36:06.746Z vite:hmr (ssr) [no modules matched] debug.log
2025-11-20T03:36:06.988Z vite:resolve 0.40ms /@vite/client -> /home/projects/vitejs-vite-wcozggna/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/client.mjs
2025-11-20T03:36:06.990Z vite:load 0.20ms [plugin] /@react-refresh
2025-11-20T03:36:06.992Z vite:import-analysis 0.60ms [0 imports rewritten] /@react-refresh
2025-11-20T03:36:06.993Z vite:transform 2.61ms /@react-refresh
2025-11-20T03:36:07.000Z vite:time 10.99ms /@react-refresh
2025-11-20T03:36:07.006Z vite:load 18.55ms [fs] /@vite/client
2025-11-20T03:36:07.008Z vite:resolve 0.19ms @vite/env -> /home/projects/vitejs-vite-wcozggna/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/env.mjs
2025-11-20T03:36:07.008Z vite:import-analysis 1.27ms [1 imports rewritten] node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/client.mjs
2025-11-20T03:36:07.008Z vite:transform 1.80ms /@vite/client
2025-11-20T03:36:07.014Z vite:time 26.50ms /@vite/client
2025-11-20T03:36:07.022Z vite:hmr [file change] debug.log
2025-11-20T03:36:07.023Z vite:hmr (client) [no modules matched] debug.log
2025-11-20T03:36:07.023Z vite:hmr (ssr) [no modules matched] debug.log
2025-11-20T03:36:07.024Z vite:load 15.69ms [fs] /node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/env.mjs
2025-11-20T03:36:07.024Z vite:import-analysis 0.04ms [no imports] node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/env.mjs
2025-11-20T03:36:07.024Z vite:transform 0.27ms /node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/env.mjs
2025-11-20T03:36:07.045Z vite:resolve 0.58ms ./index.css -> /home/projects/vitejs-vite-wcozggna/src/index.css
2025-11-20T03:36:07.045Z vite:resolve 0.63ms ./App.tsx -> /home/projects/vitejs-vite-wcozggna/src/App.tsx
2025-11-20T03:36:07.045Z vite:resolve 0.74ms react/jsx-dev-runtime -> /home/projects/vitejs-vite-wcozggna/node_modules/.vite/deps/react_jsx-dev-runtime.js?v=636f416a
2025-11-20T03:36:07.045Z vite:resolve 0.73ms react -> /home/projects/vitejs-vite-wcozggna/node_modules/.vite/deps/react.js?v=636f416a
2025-11-20T03:36:07.045Z vite:resolve 0.73ms react-dom/client -> /home/projects/vitejs-vite-wcozggna/node_modules/.vite/deps/react-dom_client.js?v=636f416a
2025-11-20T03:36:07.046Z vite:import-analysis /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=636f416a needs interop
2025-11-20T03:36:07.049Z vite:import-analysis /node_modules/.vite/deps/react.js?v=636f416a needs interop
2025-11-20T03:36:07.049Z vite:import-analysis /node_modules/.vite/deps/react-dom_client.js?v=636f416a needs interop
2025-11-20T03:36:07.049Z vite:optimize-deps load /home/projects/vitejs-vite-wcozggna/node_modules/.vite/deps/react_jsx-dev-runtime.js
2025-11-20T03:36:07.049Z vite:optimize-deps load /home/projects/vitejs-vite-wcozggna/node_modules/.vite/deps/react.js
2025-11-20T03:36:07.050Z vite:optimize-deps load /home/projects/vitejs-vite-wcozggna/node_modules/.vite/deps/react-dom_client.js
2025-11-20T03:36:07.050Z vite:import-analysis 5.29ms [5 imports rewritten] src/main.tsx
2025-11-20T03:36:07.052Z vite:transform 310.69ms /src/main.tsx
2025-11-20T03:36:07.052Z vite:time 63.13ms /src/main.tsx
2025-11-20T03:36:07.055Z vite:load 6.00ms [fs] /src/App.tsx
2025-11-20T03:36:07.055Z vite:load 6.11ms [fs] /src/index.css
2025-11-20T03:36:07.056Z vite:load 6.99ms [plugin] /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=636f416a
2025-11-20T03:36:07.056Z vite:load 7.05ms [plugin] /node_modules/.vite/deps/react.js?v=636f416a
2025-11-20T03:36:07.065Z vite:resolve 0.62ms ./chunk-KAB5DSLR.js -> /home/projects/vitejs-vite-wcozggna/node_modules/.vite/deps/chunk-KAB5DSLR.js?v=636f416a
2025-11-20T03:36:07.065Z vite:hmr [self-accepts] src/index.css
2025-11-20T03:36:07.065Z vite:import-analysis 0.22ms [0 imports rewritten] src/index.css
2025-11-20T03:36:07.065Z vite:transform 9.98ms /src/index.css
2025-11-20T03:36:07.066Z vite:optimize-deps load /home/projects/vitejs-vite-wcozggna/node_modules/.vite/deps/chunk-KAB5DSLR.js
2025-11-20T03:36:07.066Z vite:import-analysis 1.70ms [1 imports rewritten] node_modules/.vite/deps/react_jsx-dev-runtime.js?v=636f416a
2025-11-20T03:36:07.066Z vite:import-analysis 1.72ms [1 imports rewritten] node_modules/.vite/deps/react.js?v=636f416a
2025-11-20T03:36:07.066Z vite:transform 9.47ms /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=636f416a
2025-11-20T03:36:07.067Z vite:transform 10.18ms /node_modules/.vite/deps/react.js?v=636f416a
2025-11-20T03:36:07.068Z vite:load 18.40ms [plugin] /node_modules/.vite/deps/react-dom_client.js?v=636f416a
2025-11-20T03:36:07.079Z vite:resolve 0.15ms ./chunk-LBRKDTSF.js -> /home/projects/vitejs-vite-wcozggna/node_modules/.vite/deps/chunk-LBRKDTSF.js?v=636f416a
2025-11-20T03:36:07.079Z vite:optimize-deps load /home/projects/vitejs-vite-wcozggna/node_modules/.vite/deps/chunk-LBRKDTSF.js
2025-11-20T03:36:07.079Z vite:import-analysis 8.91ms [2 imports rewritten] node_modules/.vite/deps/react-dom_client.js?v=636f416a
2025-11-20T03:36:07.079Z vite:transform 11.46ms /node_modules/.vite/deps/react-dom_client.js?v=636f416a
2025-11-20T03:36:07.136Z vite:load 70.40ms [plugin] /node_modules/.vite/deps/chunk-KAB5DSLR.js?v=636f416a
2025-11-20T03:36:07.137Z vite:import-analysis 0.87ms [no imports] node_modules/.vite/deps/chunk-KAB5DSLR.js?v=636f416a
2025-11-20T03:36:07.137Z vite:transform 1.13ms [skipped] /node_modules/.vite/deps/chunk-KAB5DSLR.js?v=636f416a
2025-11-20T03:36:07.140Z vite:load 60.86ms [plugin] /node_modules/.vite/deps/chunk-LBRKDTSF.js?v=636f416a
2025-11-20T03:36:07.141Z vite:cache [memory] /node_modules/.vite/deps/chunk-KAB5DSLR.js?v=636f416a
2025-11-20T03:36:07.141Z vite:import-analysis 0.79ms [1 imports rewritten] node_modules/.vite/deps/chunk-LBRKDTSF.js?v=636f416a
2025-11-20T03:36:07.141Z vite:transform 1.10ms /node_modules/.vite/deps/chunk-LBRKDTSF.js?v=636f416a
2025-11-20T03:36:07.144Z vite:html-fallback Rewriting GET / to /index.html
2025-11-20T03:36:07.146Z vite:resolve 0.91ms ./Foo -> /home/projects/vitejs-vite-wcozggna/src/Foo/index.ts
2025-11-20T03:36:07.146Z vite:resolve 0.97ms ./App.css -> /home/projects/vitejs-vite-wcozggna/src/App.css
2025-11-20T03:36:07.146Z vite:cache [memory] /@react-refresh
2025-11-20T03:36:07.146Z vite:import-analysis /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=636f416a needs interop
2025-11-20T03:36:07.146Z vite:import-analysis /node_modules/.vite/deps/react.js?v=636f416a needs interop
2025-11-20T03:36:07.146Z vite:cache [memory] /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=636f416a
2025-11-20T03:36:07.146Z vite:cache [memory] /node_modules/.vite/deps/react.js?v=636f416a
2025-11-20T03:36:07.147Z vite:hmr [self-accepts] src/App.tsx
2025-11-20T03:36:07.147Z vite:import-analysis 2.25ms [5 imports rewritten] src/App.tsx
2025-11-20T03:36:07.148Z vite:transform 92.14ms /src/App.tsx
2025-11-20T03:36:07.151Z vite:hmr [file change] debug.log
2025-11-20T03:36:07.151Z vite:hmr (client) [no modules matched] debug.log
2025-11-20T03:36:07.151Z vite:hmr (ssr) [no modules matched] debug.log
2025-11-20T03:36:07.151Z vite:load 4.71ms [fs] /src/Foo/index.ts
2025-11-20T03:36:07.151Z vite:load 4.78ms [fs] /src/App.css
2025-11-20T03:36:07.154Z vite:cache [memory] /src/main.tsx
2025-11-20T03:36:07.154Z vite:time 10.54ms /index.html
2025-11-20T03:36:07.155Z vite:hmr [self-accepts] src/App.css
2025-11-20T03:36:07.155Z vite:import-analysis 0.24ms [0 imports rewritten] src/App.css
2025-11-20T03:36:07.155Z vite:transform 3.46ms /src/App.css
2025-11-20T03:36:07.164Z vite:import-analysis 0.03ms [no imports] src/Foo/index.ts
2025-11-20T03:36:07.164Z vite:transform 12.30ms /src/Foo/index.ts
2025-11-20T03:36:07.180Z vite:cache [memory] /@vite/client
2025-11-20T03:36:07.188Z vite:time 7.60ms /@vite/client
2025-11-20T03:36:07.198Z vite:cache [memory] /src/main.tsx
2025-11-20T03:36:07.198Z vite:time 0.26ms /src/main.tsx
2025-11-20T03:36:07.209Z vite:hmr [file change] debug.log
2025-11-20T03:36:07.210Z vite:hmr (client) [no modules matched] debug.log
2025-11-20T03:36:07.210Z vite:hmr (ssr) [no modules matched] debug.log
2025-11-20T03:36:07.346Z vite:cache [memory] /@react-refresh
2025-11-20T03:36:07.353Z vite:time 6.31ms /@react-refresh
2025-11-20T03:36:07.358Z vite:cache [memory] /node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/env.mjs
2025-11-20T03:36:07.359Z vite:time 0.98ms /node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/client/env.mjs
2025-11-20T03:36:07.361Z vite:cache [memory] /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=636f416a
2025-11-20T03:36:07.361Z vite:time 0.24ms /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=636f416a
2025-11-20T03:36:07.361Z vite:cache [memory] /node_modules/.vite/deps/react.js?v=636f416a
2025-11-20T03:36:07.362Z vite:time 0.65ms /node_modules/.vite/deps/react.js?v=636f416a
2025-11-20T03:36:07.362Z vite:cache [memory] /node_modules/.vite/deps/react-dom_client.js?v=636f416a
2025-11-20T03:36:07.363Z vite:time 0.91ms /node_modules/.vite/deps/react-dom_client.js?v=636f416a
2025-11-20T03:36:07.423Z vite:cache [memory] /src/index.css
2025-11-20T03:36:07.423Z vite:time 0.27ms /src/index.css
2025-11-20T03:36:07.423Z vite:cache [memory] /src/App.tsx
2025-11-20T03:36:07.423Z vite:time 0.26ms /src/App.tsx
2025-11-20T03:36:07.425Z vite:hmr [file change] debug.log
2025-11-20T03:36:07.425Z vite:hmr (client) [no modules matched] debug.log
2025-11-20T03:36:07.425Z vite:hmr (ssr) [no modules matched] debug.log
2025-11-20T03:36:07.429Z vite:cache [memory] /node_modules/.vite/deps/chunk-KAB5DSLR.js?v=636f416a
2025-11-20T03:36:07.429Z vite:time 0.25ms /node_modules/.vite/deps/chunk-KAB5DSLR.js?v=636f416a
2025-11-20T03:36:07.432Z vite:cache [memory] /src/Foo/index.ts
2025-11-20T03:36:07.432Z vite:time 0.29ms /src/Foo/index.ts
2025-11-20T03:36:07.433Z vite:cache [memory] /src/App.css
2025-11-20T03:36:07.433Z vite:time 0.15ms /src/App.css
2025-11-20T03:36:07.436Z vite:cache [memory] /node_modules/.vite/deps/chunk-LBRKDTSF.js?v=636f416a
2025-11-20T03:36:07.436Z vite:time 0.21ms /node_modules/.vite/deps/chunk-LBRKDTSF.js?v=636f416a
2025-11-20T03:36:07.455Z vite:time 2.58ms /vite.svg
2025-11-20T03:36:10.531Z vite:hmr [file change] src/Foo/index.tsx
2025-11-20T03:36:10.531Z vite:hmr (client) [no modules matched] src/Foo/index.tsx
2025-11-20T03:36:10.531Z vite:hmr (ssr) [no modules matched] src/Foo/index.tsx
2025-11-20T03:36:10.538Z vite:hmr [file change] debug.log
2025-11-20T03:36:10.538Z vite:hmr (client) [no modules matched] debug.log
2025-11-20T03:36:10.538Z vite:hmr (ssr) [no modules matched] debug.log
2025-11-20T03:36:10.594Z vite:hmr [file change] src/Foo/index.ts
10:36:10 PM [vite] (client) hmr update /src/App.tsx
2025-11-20T03:36:10.595Z vite:hmr (ssr) [no modules matched] src/Foo/index.ts
2025-11-20T03:36:10.597Z vite:cache [memory-hmr] /src/App.tsx
2025-11-20T03:36:10.597Z vite:cache [memory] /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=636f416a
2025-11-20T03:36:10.597Z vite:cache [memory] /node_modules/.vite/deps/react.js?v=636f416a
2025-11-20T03:36:10.597Z vite:cache [memory] /src/App.css
2025-11-20T03:36:10.597Z vite:cache [memory] /@react-refresh
2025-11-20T03:36:10.597Z vite:time 0.76ms /src/App.tsx
10:36:10 PM [vite] (client) Pre-transform error: Failed to load url /src/Foo/index.ts (resolved id: /home/projects/vitejs-vite-wcozggna/src/Foo/index.ts) in /home/projects/vitejs-vite-wcozggna/src/App.tsx. Does the file exist?
2025-11-20T03:36:10.600Z vite:html-fallback Rewriting GET /src/Foo/index.ts?t=1763609770594 to /index.html
2025-11-20T03:36:10.600Z vite:time 0.90ms /index.html
2025-11-20T03:36:10.608Z vite:hmr [file change] debug.log
2025-11-20T03:36:10.608Z vite:hmr (client) [no modules matched] debug.log
2025-11-20T03:36:10.608Z vite:hmr (ssr) [no modules matched] debug.log
2025-11-20T03:36:16.274Z vite:hmr [file change] src/Foo/index.tsx
2025-11-20T03:36:16.274Z vite:hmr (client) [no modules matched] src/Foo/index.tsx
2025-11-20T03:36:16.274Z vite:hmr (ssr) [no modules matched] src/Foo/index.tsx
2025-11-20T03:36:16.288Z vite:hmr [file change] debug.log
2025-11-20T03:36:16.288Z vite:hmr (client) [no modules matched] debug.log
2025-11-20T03:36:16.288Z vite:hmr (ssr) [no modules matched] debug.log
Validations
- [x] Follow our Code of Conduct
- [x] Read the Contributing Guidelines.
- [x] Read the docs.
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [x] Make sure this is a Vite issue and not a framework-specific issue.
- [x] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [x] The provided reproduction is a minimal reproducible example of the bug.
The situation seems same without react plugin too. What I tested is:
- comment out
plugins: [react()]fromvite.config.ts - start
vite - open page
- rename
Foo/index.tsxtoFoo/index.ts - observe a following error (browser full reload is white screen)
11:59:46 AM [vite] (client) page reload src/Foo/index.ts
11:59:47 AM [vite] (client) Pre-transform error: Failed to load url /src/Foo/index.ts (resolved id: /home/hiroshi/Downloads/vitejs-vite-wcozggna/src/Foo/index.ts) in /home/hiroshi/Downloads/vitejs-vite-wcozggna/src/App.tsx. Does the file exist?
With react plugin, the logs are slightly different but the underlying issue looks similiar:
12:02:29 PM [vite] (client) hmr update /src/App.tsx
12:02:29 PM [vite] (client) Pre-transform error: Failed to load url /src/Foo/index.ts (resolved id: /home/hiroshi/Downloads/vitejs-vite-wcozggna/src/Foo/index.ts) in /home/hiroshi/Downloads/vitejs-vite-wcozggna/src/App.tsx. Does the file exist?