I’m in the process of migrating our legacy frontend app from Create React App (CRA) to Vite. The transition has had its challenges, but I’m nearly done. Everything is up and running locally, and I’m able to build the app successfully on my machine. However, I’m encountering an issue when deploying the app through my GitHub Actions workflow. Specifically, I’m receiving the following error during the deployment job:
[vite:load-fallback] Could not load /__w/[repo-name]/[repo-name]/src/__vite-browser-external (imported by __vite-browser-external?commonjs-proxy): ENOENT: no such file or directory, open '/__w/[repo-name]/[repo-name]/src/__vite-browser-external'
this is my vite.config.js
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import jsconfigPaths from 'vite-jsconfig-paths';
import eslintPlugin from 'vite-plugin-eslint';
export default defineConfig({
build: {
outDir: 'build',
sourcemap: true,
},
plugins: [react(), jsconfigPaths(), eslintPlugin()],
server: {
open: true,
port: 3000,
},
});
I’m not sure how to debug this or where to start, your help is much appreciated 🙏🙏
I looked up similar questions on github but no luck
Mazen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.