You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building a Vite + React project, I get the following error only on Linux (works fine on Windows): [vite:load-fallback] Could not load <module-path> ENOENT: no such file or directory
This happens during the build process. The application runs fine in development mode.
vite.config.ts
`import react from '@vitejs/plugin-react';
import * as path from 'path';
import { defineConfig } from 'vite';
import removeConsole from 'vite-plugin-remove-console';
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Hello @kashyap-cephei. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs reproduction will be closed if they have no activity within 3 days.
Describe the bug
Issue Description
When building a Vite + React project, I get the following error only on Linux (works fine on Windows):
[vite:load-fallback] Could not load <module-path> ENOENT: no such file or directory
This happens during the build process. The application runs fine in development mode.
vite.config.ts
`import react from '@vitejs/plugin-react';
import * as path from 'path';
import { defineConfig } from 'vite';
import removeConsole from 'vite-plugin-remove-console';
export default defineConfig({
plugins: [
react(),
removeConsole({
external: ['error', 'warn'],
}),
],
resolve: {
alias: {
'@components': path.resolve(__dirname, 'src/shared/components'),
'@images': path.resolve(__dirname, 'src/assets/images'),
'@iCons': path.resolve(__dirname, 'src/assets/icons'),
'@utils': path.resolve(__dirname, 'src/utils'),
'@hooks': path.resolve(__dirname, 'src/hooks'),
'@store': path.resolve(__dirname, 'src/store'),
'@api': path.resolve(__dirname, 'src/api'),
},
},
});
`
tsconfig.json
{ "compilerOptions": { "resolveJsonModule": true, "esModuleInterop": true, "baseUrl": "./src", "types": ["vite/client", "node"], "paths": { "@components/*": ["shared/components/*"], "@images/*": ["assets/images/*"], "@icons/*": ["assets/icons/*"], "@utils/*": ["utils/*"], "@hooks/*": ["hooks/*"], "@store/*": ["store/*"], "@api/*": ["api/*"] } } }
Reproduction
null
Steps to reproduce
npm run build
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: