Open ncls-alien opened 1 year ago
Couple things to maybe check:
Do you need to turn on the allowJs
option in your tsconfig? This plugin seems to use it as a signal for allowing .svelte
and .vue
files, so maybe some of that logic applies to other formats such as .svg
? https://github.com/aleclarson/vite-tsconfig-paths#allowjs
Should your public
folder be part of your include
option in the tsconfig? Since you're importing a SVG file from there and treating it as a JS module in your dependency tree, and this plugin's README says it respects include/exclude rules: https://github.com/aleclarson/vite-tsconfig-paths#includeexclude
Also wondering if importing stuff from the public
directory is a good idea, given that by default Vite treats this directory as content to copy over as-is. There might be some logic on the Vite side that prevents importing from that directory? Can you check with publicDir: false
?
@fvsch In this case I am not trying to import anything from the public folder and not an SVG. I'm trying to import a React component.
I also tried it with allowJS
turned on and the public
folder inside the include
but nothing. Either way, I moved it to src/assets
anyway so the public
folder doesn't matter anymore.
This might be a Windows issue. Run Vite with DEBUG="vite-tsconfig-paths vite:resolve-details" vite
and paste the logs here please.
This command doesn't return any logs anymore.
You might need to ask the vite-plugin-electron
folks where you can find debug logs? Idk, I've never used Vite for Electron
I don't think they have any. Can't find anything about it.
I can send the normal Vite debug logs alongside the ones from vite-tsconfig-paths
if that would help.
Oh my bad, you need to do DEBUG="vite-tsconfig-paths,vite:resolve-details" vite
(note the comma)
vite:resolve-details [package entry] vite -> G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/vite/index.cjs +0ms
vite:resolve-details [package entry] vite-plugin-electron -> G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/vite-plugin-electron/dist/index.js +2ms
vite:resolve-details [package entry] vite-plugin-electron-renderer -> G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/vite-plugin-electron-renderer/dist/index.js +1ms
vite:resolve-details [package entry] @vitejs/plugin-react -> G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/@vitejs/plugin-react/dist/index.cjs +1ms
vite:resolve-details [package entry] vite-tsconfig-paths -> G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/vite-tsconfig-paths/dist/index.js +2ms
vite:config bundled config file loaded in 281.66ms +0ms
vite:esbuild 5.81ms tsconfck init G:/Eigene Dateien/Documents/node/electron/pigeon +0ms
vite:config using resolved config: {
vite:config plugins: [
vite:config 'vite:optimized-deps',
vite:config 'vite:watch-package-data',
vite:config 'vite:pre-alias',
vite:config 'alias',
vite:config 'vite:react-babel',
vite:config 'vite:react-refresh',
vite:config 'vite-tsconfig-paths',
vite:config 'vite:modulepreload-polyfill',
vite:config 'vite:resolve',
vite:config 'vite:html-inline-proxy',
vite:config 'vite:css',
vite:config 'vite:esbuild',
vite:config 'vite:json',
vite:config 'vite:wasm-helper',
vite:config 'vite:worker',
vite:config 'vite:asset',
vite:config 'vite-plugin-electron',
vite:config 'vite-plugin-electron-renderer',
vite:config 'vite:wasm-fallback',
vite:config 'vite:define',
vite:config 'vite:css-post',
vite:config 'vite:worker-import-meta-url',
vite:config 'vite:asset-import-meta-url',
vite:config 'vite:dynamic-import-vars',
vite:config 'vite:import-glob',
vite:config 'vite:client-inject',
vite:config 'vite:import-analysis'
vite:config ],
vite:config optimizeDeps: {
vite:config disabled: 'build',
vite:config force: undefined,
vite:config include: [ 'react', 'react/jsx-dev-runtime' ],
vite:config exclude: [],
vite:config esbuildOptions: { preserveSymlinks: false }
vite:config },
vite:config server: {
vite:config preTransformRequests: true,
vite:config sourcemapIgnoreList: [Function: isInNodeModules],
vite:config middlewareMode: false,
vite:config fs: { strict: true, allow: [Array], deny: [Array] }
vite:config },
vite:config esbuild: { jsxDev: true, jsx: 'automatic', jsxImportSource: undefined },
vite:config build: {
vite:config target: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
vite:config cssTarget: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
vite:config outDir: 'dist',
vite:config assetsDir: 'assets',
vite:config assetsInlineLimit: 4096,
vite:config cssCodeSplit: true,
vite:config sourcemap: false,
vite:config rollupOptions: { onwarn: [Function: onwarn], output: [Object] },
vite:config minify: 'esbuild',
vite:config terserOptions: {},
vite:config write: true,
vite:config emptyOutDir: null,
vite:config copyPublicDir: true,
vite:config manifest: false,
vite:config lib: false,
vite:config ssr: false,
vite:config ssrManifest: false,
vite:config ssrEmitAssets: false,
vite:config reportCompressedSize: true,
vite:config chunkSizeWarningLimit: 500,
vite:config watch: null,
vite:config commonjsOptions: { include: [Array], extensions: [Array], ignore: [Array] },
vite:config dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] },
vite:config modulePreload: { polyfill: true },
vite:config cssMinify: true
vite:config },
vite:config resolve: {
vite:config mainFields: [ 'module', 'jsnext:main', 'jsnext' ],
vite:config browserField: true,
vite:config conditions: [],
vite:config extensions: [
vite:config '.mjs', '.js',
vite:config '.mts', '.ts',
vite:config '.jsx', '.tsx',
vite:config '.json'
vite:config ],
vite:config dedupe: [ 'react', 'react-dom' ],
vite:config preserveSymlinks: false,
vite:config alias: [ [Object], [Object], [Object] ]
vite:config },
vite:config base: '/',
vite:config configFile: 'G:/Eigene Dateien/Documents/node/electron/pigeon/vite.config.ts',
vite:config configFileDependencies: [ 'G:/Eigene Dateien/Documents/node/electron/pigeon/vite.config.ts' ],
vite:config inlineConfig: {
vite:config root: undefined,
vite:config base: undefined,
vite:config mode: undefined,
vite:config configFile: undefined,
vite:config logLevel: undefined,
vite:config clearScreen: undefined,
vite:config optimizeDeps: { force: undefined },
vite:config server: {}
vite:config },
vite:config root: 'G:/Eigene Dateien/Documents/node/electron/pigeon',
vite:config rawBase: '/',
vite:config publicDir: 'G:\\Eigene Dateien\\Documents\\node\\electron\\pigeon\\public',
vite:config cacheDir: 'G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/.vite',
vite:config command: 'serve',
vite:config mode: 'development',
vite:config ssr: {
vite:config format: 'esm',
vite:config target: 'node',
vite:config optimizeDeps: { disabled: true, esbuildOptions: [Object] }
vite:config },
vite:config isWorker: false,
vite:config mainConfig: null,
vite:config isProduction: false,
vite:config preview: {
vite:config port: undefined,
vite:config strictPort: undefined,
vite:config host: undefined,
vite:config https: undefined,
vite:config open: undefined,
vite:config proxy: undefined,
vite:config cors: undefined,
vite:config headers: undefined
vite:config },
vite:config envDir: 'G:/Eigene Dateien/Documents/node/electron/pigeon',
vite:config env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false },
vite:config assetsInclude: [Function: assetsInclude],
vite:config logger: {
vite:config hasWarned: false,
vite:config info: [Function: info],
vite:config warn: [Function: warn],
vite:config warnOnce: [Function: warnOnce],
vite:config error: [Function: error],
vite:config clearScreen: [Function: clearScreen],
vite:config hasErrorLogged: [Function: hasErrorLogged]
vite:config },
vite:config packageCache: Map(1) {
vite:config 'fnpd_G:/Eigene Dateien/Documents/node/electron/pigeon' => {
vite:config dir: 'G:\\Eigene Dateien\\Documents\\node\\electron\\pigeon',
vite:config data: [Object],
vite:config hasSideEffects: [Function: hasSideEffects],
vite:config webResolvedImports: {},
vite:config nodeResolvedImports: {},
vite:config setResolvedCache: [Function: setResolvedCache],
vite:config getResolvedCache: [Function: getResolvedCache]
vite:config },
vite:config set: [Function (anonymous)]
vite:config },
vite:config createResolver: [Function: createResolver],
vite:config worker: {
vite:config format: 'iife',
vite:config plugins: [
vite:config 'vite:optimized-deps',
vite:config 'vite:watch-package-data',
vite:config 'vite:pre-alias',
vite:config 'alias',
vite:config 'vite:modulepreload-polyfill',
vite:config 'vite:resolve',
vite:config 'vite:html-inline-proxy',
vite:config 'vite:css',
vite:config 'vite:esbuild',
vite:config 'vite:json',
vite:config 'vite:wasm-helper',
vite:config 'vite:worker',
vite:config 'vite:asset',
vite:config 'vite:wasm-fallback',
vite:config 'vite:define',
vite:config 'vite:css-post',
vite:config 'vite:worker-import-meta-url',
vite:config 'vite:asset-import-meta-url',
vite:config 'vite:dynamic-import-vars',
vite:config 'vite:import-glob',
vite:config 'vite:client-inject',
vite:config 'vite:import-analysis'
vite:config ],
vite:config rollupOptions: {},
vite:config getSortedPlugins: [Function: getSortedPlugins],
vite:config getSortedPluginHooks: [Function: getSortedPluginHooks]
vite:config },
vite:config appType: 'spa',
vite:config experimental: { importGlobRestoreExtension: false, hmrPartialAccept: false },
vite:config getSortedPlugins: [Function: getSortedPlugins],
vite:config getSortedPluginHooks: [Function: getSortedPluginHooks]
vite:config } +19ms
vite:deps Hash is consistent. Skipping. Use --force to override. +0ms
VITE v4.3.9 ready in 732 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h to show help
vite:config using resolved config: {
vite:config configFile: undefined,
vite:config publicDir: '',
vite:config build: {
vite:config target: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
vite:config cssTarget: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
vite:config outDir: 'dist-electron',
vite:config assetsDir: 'assets',
vite:config assetsInlineLimit: 4096,
vite:config cssCodeSplit: false,
vite:config sourcemap: false,
vite:config rollupOptions: { external: [Array] },
vite:config minify: 'esbuild',
vite:config terserOptions: {},
vite:config write: true,
vite:config emptyOutDir: false,
vite:config copyPublicDir: true,
vite:config manifest: false,
vite:config lib: {
vite:config entry: 'electron/main.ts',
vite:config formats: [Array],
vite:config fileName: [Function: fileName]
vite:config },
vite:config ssr: false,
vite:config ssrManifest: false,
vite:config ssrEmitAssets: false,
vite:config reportCompressedSize: true,
vite:config chunkSizeWarningLimit: 500,
vite:config watch: {},
vite:config commonjsOptions: { include: [Array], extensions: [Array] },
vite:config dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] },
vite:config modulePreload: { polyfill: true },
vite:config cssMinify: true
vite:config },
vite:config resolve: {
vite:config mainFields: [ 'module', 'jsnext:main', 'jsnext' ],
vite:config browserField: false,
vite:config conditions: [],
vite:config extensions: [
vite:config '.mjs', '.js',
vite:config '.mts', '.ts',
vite:config '.jsx', '.tsx',
vite:config '.json'
vite:config ],
vite:config dedupe: [],
vite:config preserveSymlinks: false,
vite:config alias: [ [Object], [Object] ]
vite:config },
vite:config mode: 'development',
vite:config plugins: [
vite:config 'vite:ensure-watch',
vite:config 'vite:build-metadata',
vite:config 'vite:watch-package-data',
vite:config 'vite:pre-alias',
vite:config 'alias',
vite:config 'vite:modulepreload-polyfill',
vite:config 'vite:resolve',
vite:config 'vite:html-inline-proxy',
vite:config 'vite:css',
vite:config 'vite:esbuild',
vite:config 'vite:json',
vite:config 'vite:wasm-helper',
vite:config 'vite:worker',
vite:config 'vite:asset',
vite:config ':startup',
vite:config 'vite:wasm-fallback',
vite:config 'vite:define',
vite:config 'vite:css-post',
vite:config 'vite:build-html',
vite:config 'vite:worker-import-meta-url',
vite:config 'vite:asset-import-meta-url',
vite:config 'vite:force-systemjs-wrap-complete',
vite:config 'vite:ensure-watch',
vite:config 'commonjs',
vite:config 'vite:data-uri',
vite:config 'vite:dynamic-import-vars',
vite:config 'vite:import-glob',
vite:config 'vite:build-import-analysis',
vite:config 'vite:esbuild-transpile',
vite:config 'vite:terser',
vite:config 'vite:reporter',
vite:config 'vite:load-fallback'
vite:config ],
vite:config configFileDependencies: [],
vite:config inlineConfig: {
vite:config configFile: false,
vite:config publicDir: false,
vite:config build: {
vite:config lib: [Object],
vite:config outDir: 'dist-electron',
vite:config emptyOutDir: false,
vite:config watch: {},
vite:config rollupOptions: [Object]
vite:config },
vite:config resolve: { browserField: false, mainFields: [Array] },
vite:config mode: 'development',
vite:config plugins: [ [Object] ]
vite:config },
vite:config root: 'G:/Eigene Dateien/Documents/node/electron/pigeon',
vite:config base: '/',
vite:config rawBase: '/',
vite:config cacheDir: 'G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/.vite',
vite:config command: 'build',
vite:config ssr: {
vite:config format: 'esm',
vite:config target: 'node',
vite:config optimizeDeps: { disabled: true, esbuildOptions: [Object] }
vite:config },
vite:config isWorker: false,
vite:config mainConfig: null,
vite:config isProduction: false,
vite:config esbuild: { jsxDev: true },
vite:config server: {
vite:config preTransformRequests: true,
vite:config sourcemapIgnoreList: [Function: isInNodeModules],
vite:config middlewareMode: false,
vite:config fs: { strict: true, allow: [Array], deny: [Array] }
vite:config },
vite:config preview: {
vite:config port: undefined,
vite:config strictPort: undefined,
vite:config host: undefined,
vite:config https: undefined,
vite:config open: undefined,
vite:config proxy: undefined,
vite:config cors: undefined,
vite:config headers: undefined
vite:config },
vite:config envDir: 'G:/Eigene Dateien/Documents/node/electron/pigeon',
vite:config env: {
vite:config VITE_DEV_SERVER_URL: 'http://localhost:5173/',
vite:config BASE_URL: '/',
vite:config MODE: 'development',
vite:config DEV: true,
vite:config PROD: false
vite:config },
vite:config assetsInclude: [Function: assetsInclude],
vite:config logger: {
vite:config hasWarned: false,
vite:config info: [Function: info],
vite:config warn: [Function: warn],
vite:config warnOnce: [Function: warnOnce],
vite:config error: [Function: error],
vite:config clearScreen: [Function: clearScreen],
vite:config hasErrorLogged: [Function: hasErrorLogged]
vite:config },
vite:config packageCache: Map(1) {
vite:config 'fnpd_G:/Eigene Dateien/Documents/node/electron/pigeon' => {
vite:config dir: 'G:\\Eigene Dateien\\Documents\\node\\electron\\pigeon',
vite:config data: [Object],
vite:config hasSideEffects: [Function: hasSideEffects],
vite:config webResolvedImports: {},
vite:config nodeResolvedImports: {},
vite:config setResolvedCache: [Function: setResolvedCache],
vite:config getResolvedCache: [Function: getResolvedCache]
vite:config },
vite:config set: [Function (anonymous)]
vite:config },
vite:config createResolver: [Function: createResolver],
vite:config optimizeDeps: { disabled: 'build', esbuildOptions: { preserveSymlinks: false } },
vite:config worker: {
vite:config format: 'iife',
vite:config plugins: [
vite:config 'vite:ensure-watch',
vite:config 'vite:build-metadata',
vite:config 'vite:watch-package-data',
vite:config 'vite:pre-alias',
vite:config 'alias',
vite:config 'vite:modulepreload-polyfill',
vite:config 'vite:resolve',
vite:config 'vite:html-inline-proxy',
vite:config 'vite:css',
vite:config 'vite:esbuild',
vite:config 'vite:json',
vite:config 'vite:wasm-helper',
vite:config 'vite:worker',
vite:config 'vite:asset',
vite:config 'vite:wasm-fallback',
vite:config 'vite:define',
vite:config 'vite:css-post',
vite:config 'vite:build-html',
vite:config 'vite:worker-import-meta-url',
vite:config 'vite:asset-import-meta-url',
vite:config 'vite:force-systemjs-wrap-complete',
vite:config 'vite:ensure-watch',
vite:config 'commonjs',
vite:config 'vite:data-uri',
vite:config 'vite:worker-post',
vite:config 'vite:dynamic-import-vars',
vite:config 'vite:import-glob',
vite:config 'vite:build-import-analysis',
vite:config 'vite:esbuild-transpile',
vite:config 'vite:terser',
vite:config 'vite:load-fallback'
vite:config ],
vite:config rollupOptions: {},
vite:config getSortedPlugins: [Function: getSortedPlugins],
vite:config getSortedPluginHooks: [Function: getSortedPluginHooks]
vite:config },
vite:config appType: 'spa',
vite:config experimental: { importGlobRestoreExtension: false, hmrPartialAccept: false },
vite:config getSortedPlugins: [Function: getSortedPlugins],
vite:config getSortedPluginHooks: [Function: getSortedPluginHooks]
vite:config } +0ms
vite:config using resolved config: {
vite:config configFile: undefined,
vite:config publicDir: '',
vite:config build: {
vite:config target: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
vite:config cssTarget: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
vite:config outDir: 'dist-electron',
vite:config assetsDir: 'assets',
vite:config assetsInlineLimit: 4096,
vite:config cssCodeSplit: false,
vite:config sourcemap: false,
vite:config rollupOptions: { external: [Array] },
vite:config minify: 'esbuild',
vite:config terserOptions: {},
vite:config write: true,
vite:config emptyOutDir: false,
vite:config copyPublicDir: true,
vite:config manifest: false,
vite:config lib: {
vite:config entry: 'electron/preload.ts',
vite:config formats: [Array],
vite:config fileName: [Function: fileName]
vite:config },
vite:config ssr: false,
vite:config ssrManifest: false,
vite:config ssrEmitAssets: false,
vite:config reportCompressedSize: true,
vite:config chunkSizeWarningLimit: 500,
vite:config watch: {},
vite:config commonjsOptions: { include: [Array], extensions: [Array] },
vite:config dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] },
vite:config modulePreload: { polyfill: true },
vite:config cssMinify: true
vite:config },
vite:config resolve: {
vite:config mainFields: [ 'module', 'jsnext:main', 'jsnext' ],
vite:config browserField: false,
vite:config conditions: [],
vite:config extensions: [
vite:config '.mjs', '.js',
vite:config '.mts', '.ts',
vite:config '.jsx', '.tsx',
vite:config '.json'
vite:config ],
vite:config dedupe: [],
vite:config preserveSymlinks: false,
vite:config alias: [ [Object], [Object] ]
vite:config },
vite:config mode: 'development',
vite:config plugins: [
vite:config 'vite:ensure-watch',
vite:config 'vite:build-metadata',
vite:config 'vite:watch-package-data',
vite:config 'vite:pre-alias',
vite:config 'alias',
vite:config 'vite:modulepreload-polyfill',
vite:config 'vite:resolve',
vite:config 'vite:html-inline-proxy',
vite:config 'vite:css',
vite:config 'vite:esbuild',
vite:config 'vite:json',
vite:config 'vite:wasm-helper',
vite:config 'vite:worker',
vite:config 'vite:asset',
vite:config ':startup',
vite:config 'vite:wasm-fallback',
vite:config 'vite:define',
vite:config 'vite:css-post',
vite:config 'vite:build-html',
vite:config 'vite:worker-import-meta-url',
vite:config 'vite:asset-import-meta-url',
vite:config 'vite:force-systemjs-wrap-complete',
vite:config 'vite:ensure-watch',
vite:config 'commonjs',
vite:config 'vite:data-uri',
vite:config 'vite:dynamic-import-vars',
vite:config 'vite:import-glob',
vite:config 'vite:build-import-analysis',
vite:config 'vite:esbuild-transpile',
vite:config 'vite:terser',
vite:config 'vite:reporter',
vite:config 'vite:load-fallback'
vite:config ],
vite:config configFileDependencies: [],
vite:config inlineConfig: {
vite:config configFile: false,
vite:config publicDir: false,
vite:config build: {
vite:config lib: [Object],
vite:config outDir: 'dist-electron',
vite:config emptyOutDir: false,
vite:config watch: {},
vite:config rollupOptions: [Object]
vite:config },
vite:config resolve: { browserField: false, mainFields: [Array] },
vite:config mode: 'development',
vite:config plugins: [ [Object] ]
vite:config },
vite:config root: 'G:/Eigene Dateien/Documents/node/electron/pigeon',
vite:config base: '/',
vite:config rawBase: '/',
vite:config cacheDir: 'G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/.vite',
vite:config command: 'build',
vite:config ssr: {
vite:config format: 'esm',
vite:config target: 'node',
vite:config optimizeDeps: { disabled: true, esbuildOptions: [Object] }
vite:config },
vite:config isWorker: false,
vite:config mainConfig: null,
vite:config isProduction: false,
vite:config esbuild: { jsxDev: true },
vite:config server: {
vite:config preTransformRequests: true,
vite:config sourcemapIgnoreList: [Function: isInNodeModules],
vite:config middlewareMode: false,
vite:config fs: { strict: true, allow: [Array], deny: [Array] }
vite:config },
vite:config preview: {
vite:config port: undefined,
vite:config strictPort: undefined,
vite:config host: undefined,
vite:config https: undefined,
vite:config open: undefined,
vite:config proxy: undefined,
vite:config cors: undefined,
vite:config headers: undefined
vite:config },
vite:config envDir: 'G:/Eigene Dateien/Documents/node/electron/pigeon',
vite:config env: {
vite:config VITE_DEV_SERVER_URL: 'http://localhost:5173/',
vite:config BASE_URL: '/',
vite:config MODE: 'development',
vite:config DEV: true,
vite:config PROD: false
vite:config },
vite:config assetsInclude: [Function: assetsInclude],
vite:config logger: {
vite:config hasWarned: false,
vite:config info: [Function: info],
vite:config warn: [Function: warn],
vite:config warnOnce: [Function: warnOnce],
vite:config error: [Function: error],
vite:config clearScreen: [Function: clearScreen],
vite:config hasErrorLogged: [Function: hasErrorLogged]
vite:config },
vite:config packageCache: Map(1) {
vite:config 'fnpd_G:/Eigene Dateien/Documents/node/electron/pigeon' => {
vite:config dir: 'G:\\Eigene Dateien\\Documents\\node\\electron\\pigeon',
vite:config data: [Object],
vite:config hasSideEffects: [Function: hasSideEffects],
vite:config webResolvedImports: {},
vite:config nodeResolvedImports: {},
vite:config setResolvedCache: [Function: setResolvedCache],
vite:config getResolvedCache: [Function: getResolvedCache]
vite:config },
vite:config set: [Function (anonymous)]
vite:config },
vite:config createResolver: [Function: createResolver],
vite:config optimizeDeps: { disabled: 'build', esbuildOptions: { preserveSymlinks: false } },
vite:config worker: {
vite:config format: 'iife',
vite:config plugins: [
vite:config 'vite:ensure-watch',
vite:config 'vite:build-metadata',
vite:config 'vite:watch-package-data',
vite:config 'vite:pre-alias',
vite:config 'alias',
vite:config 'vite:modulepreload-polyfill',
vite:config 'vite:resolve',
vite:config 'vite:html-inline-proxy',
vite:config 'vite:css',
vite:config 'vite:esbuild',
vite:config 'vite:json',
vite:config 'vite:wasm-helper',
vite:config 'vite:worker',
vite:config 'vite:asset',
vite:config 'vite:wasm-fallback',
vite:config 'vite:define',
vite:config 'vite:css-post',
vite:config 'vite:build-html',
vite:config 'vite:worker-import-meta-url',
vite:config 'vite:asset-import-meta-url',
vite:config 'vite:force-systemjs-wrap-complete',
vite:config 'vite:ensure-watch',
vite:config 'commonjs',
vite:config 'vite:data-uri',
vite:config 'vite:worker-post',
vite:config 'vite:dynamic-import-vars',
vite:config 'vite:import-glob',
vite:config 'vite:build-import-analysis',
vite:config 'vite:esbuild-transpile',
vite:config 'vite:terser',
vite:config 'vite:load-fallback'
vite:config ],
vite:config rollupOptions: {},
vite:config getSortedPlugins: [Function: getSortedPlugins],
vite:config getSortedPluginHooks: [Function: getSortedPluginHooks]
vite:config },
vite:config appType: 'spa',
vite:config experimental: { importGlobRestoreExtension: false, hmrPartialAccept: false },
vite:config getSortedPlugins: [Function: getSortedPlugins],
vite:config getSortedPluginHooks: [Function: getSortedPluginHooks]
vite:config } +3ms
vite v4.3.9 building for development...
watching for file changes...
vite v4.3.9 building for development...
watching for file changes...
vite:esbuild 23.26ms tsconfck init G:/Eigene Dateien/Documents/node/electron/pigeon +0ms
build started...
build started... (x2)
vite:resolve-details [fs] G:\Eigene Dateien\Documents\node\electron\pigeon\electron\main.ts -> G:/Eigene Dateien/Documents/node/electron/pigeon/electron/main.ts +0ms
vite:resolve-details [fs] G:\Eigene Dateien\Documents\node\electron\pigeon\electron\preload.ts -> G:/Eigene Dateien/Documents/node/electron/pigeon/electron/preload.ts +1ms
✓ 1 modules transformed.
✓ 1 modules transformed. (x2)
vite:hmr [file change] dist-electron/main.js +0ms
vite:hmr [no modules matched] dist-electron/main.js +0ms
vite:hmr [file change] dist-electron/preload.js +1ms
vite:hmr [no modules matched] dist-electron/preload.js +0ms
dist-electron/main.js 0.75 kB │ gzip: 0.46 kB
built in 104ms.
dist-electron/preload.js 1.55 kB │ gzip: 0.76 kB
built in 111ms.
vite:html-fallback Rewriting GET / to /index.html +0ms
vite:resolve-details [url] /src/main.tsx -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/main.tsx +2s
vite:time 21.74ms /index.html +0ms
vite:resolve 4.57ms /src/main.tsx -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/main.tsx +0ms
vite:resolve-details [url] /src/main.tsx -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/main.tsx +3ms
vite:load 1.79ms [fs] /src/main.tsx +0ms
vite:resolve-details [url] /src/main.tsx -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/main.tsx +3ms
vite:resolve-details [relative] ./App.tsx -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/App.tsx +49ms
vite:resolve-details [relative] ./index.css -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/index.css +0ms
vite:resolve 2.21ms ./App.tsx -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/App.tsx +53ms
vite:resolve 2.14ms ./index.css -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/index.css +0ms
vite:resolve 2.45ms react/jsx-dev-runtime -> G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/.vite/deps/react_jsx-dev-runtime.js?v=d54b5d91 +0ms
vite:resolve 2.60ms react -> G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/.vite/deps/react.js?v=d54b5d91 +0ms
vite:resolve 2.67ms react-dom/client -> G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/.vite/deps/react-dom_client.js?v=d54b5d91 +0ms
vite:import-analysis /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=d54b5d91 needs interop +0ms
vite:import-analysis /node_modules/.vite/deps/react.js?v=d54b5d91 needs interop +2ms
vite:import-analysis /node_modules/.vite/deps/react-dom_client.js?v=d54b5d91 needs interop +1ms
vite:optimize-deps load G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/.vite/deps/react_jsx-dev-runtime.js +0ms
vite:optimize-deps load G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/.vite/deps/react.js +0ms
vite:optimize-deps load G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/.vite/deps/react-dom_client.js +0ms
vite:import-analysis 9.51ms [5 imports rewritten] G:/Eigene Dateien/Documents/Node/electron/pigeon/src/main.tsx +1ms
vite:transform 56.65ms /src/main.tsx +0ms
vite:load 4.89ms [plugin] /node_modules/.vite/deps/react.js?v=d54b5d91 +59ms
vite:resolve 0.29ms ./chunk-ERAOJNUZ.js -> G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/.vite/deps/chunk-ERAOJNUZ.js?v=d54b5d91 +11ms
vite:optimize-deps load G:/Eigene Dateien/Documents/node/electron/pigeon/node_modules/.vite/deps/chunk-ERAOJNUZ.js +6ms
vite:import-analysis 0.89ms [1 imports rewritten] node_modules\.vite\deps\react.js?v=d54b5d91 +5ms
vite:transform 1.54ms /node_modules/.vite/deps/react.js?v=d54b5d91 +2ms
vite:load 6.77ms [plugin] /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=d54b5d91 +2ms
vite:import-analysis 1.24ms [1 imports rewritten] node_modules\.vite\deps\react_jsx-dev-runtime.js?v=d54b5d91 +2ms
vite:transform 1.46ms /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=d54b5d91 +2ms
vite:load 11.84ms [fs] src\index.css +1ms
vite:load 14.60ms [fs] src\App.tsx +3ms
vite:resolve-details [relative] ./App.css -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/App.css +29ms
vite:resolve 0.81ms ./App.css -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/App.css +18ms
vite:resolve-details [fallthrough] @components/titlebar +1ms
vite:resolve 1.91ms @components/titlebar -> null +1ms
vite:import-analysis /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=d54b5d91 needs interop +17ms
vite:load 0.76ms [plugin] /@react-refresh +15ms
vite:cache [memory] /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=d54b5d91 +0ms
Failed to resolve import "@components/titlebar" from "src\App.tsx". Does the file exist?
vite:import-analysis 0.50ms [0 imports rewritten] /@react-refresh +3ms
vite:transform 1.23ms /@react-refresh +20ms
vite:load 28.58ms [plugin] /node_modules/.vite/deps/react-dom_client.js?v=d54b5d91 +3ms
vite:import-analysis 6.25ms [1 imports rewritten] node_modules\.vite\deps\react-dom_client.js?v=d54b5d91 +9ms
vite:transform 8.83ms /node_modules/.vite/deps/react-dom_client.js?v=d54b5d91 +9ms
vite:load 33.49ms [plugin] /node_modules/.vite/deps/chunk-ERAOJNUZ.js?v=d54b5d91 +11ms
vite:import-analysis 0.70ms [no imports] node_modules\.vite\deps\chunk-ERAOJNUZ.js?v=d54b5d91 +4ms
vite:transform 1.03ms /node_modules/.vite/deps/chunk-ERAOJNUZ.js?v=d54b5d91 +4ms
vite:resolve-details [url] /index.html -> G:/Eigene Dateien/Documents/Node/electron/pigeon/index.html +211ms
vite:resolve 0.38ms /index.html -> G:/Eigene Dateien/Documents/Node/electron/pigeon/index.html +211ms
vite:resolve-details [url] /src/vite-env.d.ts -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/vite-env.d.ts +0ms
vite:resolve 0.37ms /src/vite-env.d.ts -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/vite-env.d.ts +1ms
vite:resolve-details [url] /src/App.tsx -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/App.tsx +1ms
vite:resolve 0.28ms /src/App.tsx -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/App.tsx +0ms
vite:resolve-details [url] /src/components/titlebar.tsx -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/components/titlebar.tsx +0ms
vite:resolve 0.26ms /src/components/titlebar.tsx -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/components/titlebar.tsx +0ms
vite:resolve-details [url] /tailwind.config.js -> G:/Eigene Dateien/Documents/Node/electron/pigeon/tailwind.config.js +1ms
vite:resolve 0.24ms /tailwind.config.js -> G:/Eigene Dateien/Documents/Node/electron/pigeon/tailwind.config.js +1ms
vite:hmr [self-accepts] G:/Eigene Dateien/Documents/Node/electron/pigeon/src/index.css +1s
vite:import-analysis 0.29ms [0 imports rewritten] G:/Eigene Dateien/Documents/Node/electron/pigeon/src/index.css +197ms
vite:transform 229.21ms src\index.css +198ms
vite:resolve-details [@fs] /@fs/G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/client.mjs -> G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/client.mjs +2ms
vite:resolve 0.47ms /@vite/client -> G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/client.mjs +2ms
vite:resolve-details [@fs] /@fs/G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/client.mjs -> G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/client.mjs +0ms
vite:resolve-details [@fs] /@fs/G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/client.mjs -> G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/client.mjs +0ms
vite:cache [304] /src/main.tsx +0ms
vite:time 0.30ms /src/main.tsx +300ms
vite:cache [304] /@react-refresh +1ms
vite:time 0.24ms /@react-refresh +1ms
vite:load 216.32ms [fs] src\App.css +202ms
vite:hmr [self-accepts] G:/Eigene Dateien/Documents/Node/electron/pigeon/src/App.css +9ms
vite:import-analysis 0.23ms [0 imports rewritten] G:/Eigene Dateien/Documents/Node/electron/pigeon/src/App.css +9ms
vite:transform 5.03ms src\App.css +8ms
vite:cache [304] src\index.css +6ms
vite:time 0.14ms ..\..\..\..\..\Eigene%20Dateien\Documents\Node\electron\pigeon\src\index.css +7ms
vite:load 8.55ms [fs] /@vite/client +7ms
vite:load 1.05ms [fs] src\App.tsx +0ms
vite:resolve-details [@fs] /@fs/G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/client.mjs -> G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/client.mjs +13ms
vite:resolve-details [@fs] /@fs/G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/env.mjs -> G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/env.mjs +10ms
vite:resolve 0.29ms @vite/env -> G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/env.mjs +23ms
vite:import-analysis 0.98ms [1 imports rewritten] G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/client.mjs +17ms
vite:transform 10.27ms /@vite/client +17ms
vite:time 24.92ms /@vite/client +15ms
vite:resolve-details [relative] ./App.css -> G:/Eigene Dateien/Documents/Node/electron/pigeon/src/App.css +3ms
vite:resolve-details [fallthrough] @components/titlebar +0ms
vite:cache [memory] /@react-refresh +240ms
vite:cache [memory] src\App.css +1ms
vite:import-analysis /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=d54b5d91 needs interop +3ms
vite:cache [memory] /node_modules/.vite/deps/react_jsx-dev-runtime.js?v=d54b5d91 +0ms
00:32:18 [vite] Internal server error: Failed to resolve import "@components/titlebar" from "src\App.tsx". Does the file exist?
Plugin: vite:import-analysis
File: G:/Eigene Dateien/Documents/Node/electron/pigeon/src/App.tsx:2:21
16 | }
17 | import "./App.css";
18 | import TitleBar from "@components/titlebar";
| ^
19 | function App() {
20 | return /* @__PURE__ */ jsxDEV("div", { className: "bg-primary text-primary", children: /* @__PURE__ */ jsxDEV(TitleBar, {}, void 0, false, {
at formatError (file:///G:/Eigene%20Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:42645:46)
at TransformContext.error (file:///G:/Eigene%20Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:42641:19)
at normalizeUrl (file:///G:/Eigene%20Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:40508:33)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///G:/Eigene%20Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:40651:47
at async Promise.all (index 4)
at async TransformContext.transform (file:///G:/Eigene%20Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:40577:13)
at async Object.transform (file:///G:/Eigene%20Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:42919:30)
at async loadAndTransform (file:///G:/Eigene%20Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53385:29)
vite:time 24.35ms ..\..\..\..\..\Eigene%20Dateien\Documents\Node\electron\pigeon\src\App.tsx +8ms
vite:load 9.48ms [fs] node_modules\vite\dist\client\env.mjs +24ms
vite:import-analysis 0.02ms [no imports] G:/Eigene Dateien/Documents/Node/electron/pigeon/node_modules/vite/dist/client/env.mjs +7ms
vite:transform 0.26ms node_modules\vite\dist\client\env.mjs +10ms
vite:time 1.17ms ..\..\..\..\..\Eigene%20Dateien\Documents\Node\electron\pigeon\node_modules\vite\dist\client\env.mjs +2ms
Any progress? Same issue with vite-plugin-electron XD
Having the same issue here. When checking the debug logs, it looks like exactly the items that match tsconfig.json#compilerOptions.paths
are marked as [fallthrough]
, e.g.
vite:resolve-details [fallthrough] @/pages/index +0ms
vite:resolve-details [fallthrough] @/pages/index +0ms
And eventually the same imports are not resolved/found:
Failed to load url @/pages/index (resolved id: @/pages/index)
Seeing the same in the other debug log above.
The fallthrough
logic I find at https://github.com/vitejs/vite/blob/eef4aaa063ed420c213cb9e24f680230cf2132b2/packages/vite/src/node/plugins/resolve.ts#L430
Then I found the getIncluder
logic here in vite-tsconfig-paths
and I'm convinced that in my case my include
paths caused the issue.
In my local lib/tsconfig.json
:
{
"extends": "./some/path/far/away/tsconfig-base.json",
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
}
}
And that tsconfig-base.json
contains this:
{
"include": ["../../../src/**/*.ts"]
}
I believe the issue is that (vite
or) this plugin does not resolve the include
entries against the file in which they're defined. Because they seem unchanged in the debug logs.
When I override the include
entries in lib/tsconfig.json
all is fine. Hope this helps :)
I changed tsconfig.json
"allowJs" filed value to "true"
then the plugin works well
In my case it works with pnpm and doesn't work with npm\bun
npm run build
log:
vite v5.2.11 building for production...
vite:resolve-details [fs] w:\web\santehnica.ru\bun-issue\index.html -> W:/web/santehnica.ru/bun-issue/index.html +74ms
transforming (1) index.html vite:resolve-details [url] /src/main.ts -> W:/web/santehnica.ru/bun-issue/src/main.ts +21ms
vite:resolve-details [relative] ./style.css -> W:/web/santehnica.ru/bun-issue/src/style.css +11ms
vite:resolve-details [relative] ./typescript.svg -> W:/web/santehnica.ru/bun-issue/src/typescript.svg +1ms
vite:resolve-details [fallthrough] /vite.svg +0ms
vite:resolve-details [relative] ./counter.ts -> W:/web/santehnica.ru/bun-issue/src/counter.ts +1ms
vite:resolve-details [fallthrough] @js/test.ts +0ms
vite:resolve-details [fallthrough] @js/test.ts +1ms
✓ 3 modules transformed.
x Build failed in 42ms
pnpm run build
log:
vite v5.2.11 building for production...
vite:resolve-details [fs] D:\temp\bun-issue\index.html -> D:/temp/bun-issue/index.html +85ms
transforming (1) index.html vite:resolve-details [url] /src/main.ts -> D:/temp/bun-issue/src/main.ts +21ms
vite:resolve-details [relative] ./style.css -> D:/temp/bun-issue/src/style.css +10ms
vite:resolve-details [relative] ./typescript.svg -> D:/temp/bun-issue/src/typescript.svg +0ms
vite:resolve-details [fallthrough] /vite.svg +1ms
vite:resolve-details [relative] ./counter.ts -> D:/temp/bun-issue/src/counter.ts +0ms
vite:resolve-details [fs] D:\temp\bun-issue\src\js\test.ts -> D:/temp/bun-issue/src/js/test.ts +1ms
vite-tsconfig-paths resolved: {
id: '@js/test.ts',
importer: 'D:/temp/bun-issue/src/main.ts',
resolvedId: 'D:/temp/bun-issue/src/js/test.ts',
configPath: 'D:/temp/bun-issue/tsconfig.json'
} +70ms
✓ 8 modules transformed.
dist/index.html 0.46 kB │ gzip: 0.29 kB
dist/assets/index-Cz4zGhbH.css 1.21 kB │ gzip: 0.62 kB
dist/assets/index-v3LfW65U.js 3.07 kB │ gzip: 1.65 kB
✓ built in 83ms
I tried for over 3 hours to find what I am missing but I can't find any mistake, however, none of my paths is being changed by the plugin. Debug is not outputting anything useful despite the fact that it loads the configs correctly.
Error:
vite.config.ts:
tsconfig.json: