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
I'm trying to use vike({ prerender: true }) in my vite.config.ts file. When I run npm start, I see the following error:
2:13:19 PM [vike][request(2)][Wrong Usage] No *.page.js file found. You must create at least one *.page.js file.
2:13:19 PM [vike][request(2)] HTTP response / ERR
Here is my vite.config.ts file:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import svgrPlugin from 'vite-plugin-svgr'
import envCompatible from 'vite-plugin-env-compatible'
import { ViteEjsPlugin } from 'vite-plugin-ejs'
import checker from 'vite-plugin-checker'
import vike from 'vike/plugin'
// vite.config.ts
const isProduction = process.env.NODE_ENV === 'production'
const profiling = isProduction && {
'react-dom/client': 'react-dom/profiling',
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
// create react components from svg files as cra does
svgrPlugin(),
// changes the VITE_ env prefix to REACT_APP_
envCompatible({ prefix: 'REACT_APP_' }),
// enable ejs templates for the index.html generation
ViteEjsPlugin(),
vike({ prerender: true }),
// enable typescript type checking in development
checker({
typescript: true,
enableBuild: false,
}),
],
build: {
outDir: 'build',
},
server: {
open: true,
port: 3000,
proxy: {
'/api': 'http://127.0.0.1:8001',
},
},
resolve: {
alias: {
...profiling,
},
},
})
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there,
I'm trying to use vike({ prerender: true }) in my vite.config.ts file. When I run
npm start
, I see the following error:Here is my vite.config.ts file:
Any help is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions