Open 7Red4 opened 1 year ago
Same issue, but getting the different error while starting the dev build:
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import eslint from 'vite-plugin-eslint';
import { visualizer } from 'rollup-plugin-visualizer';
import mix from 'vite-plugin-mix';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
plugins: [
react(),
eslint({ exclude: ['**/virtual:/**', '**/node_modules/**'] }),
visualizer({
filename: './tmp/bundle-visualizer.html',
}),
mix({
handler: './api/router.ts',
}),
],
base: env.VITE_BASE_PUBLIC_PATH,
test: {
environment: 'jsdom',
},
resolve: {
alias: [{ find: '@', replacement: '/src' }],
},
server: {
port: 3000,
},
preview: {
port: 4173,
},
};
});
Hi!
My situation is I'm going to serve my project which is only accessable under a path e.g.
https://example.com/prefix-path/
So I set the base in my configAfter I build and run
node /build/server.js
I can view my app correctly and keep getting this error belowWonder am I using this wrong or if there have any solution for this.
thanks.