frandiox / vite-ssr

Use Vite for server side rendering in Node
MIT License
823 stars 91 forks source link

Internal server error: render is not a function #202

Closed phlegx closed 1 year ago

phlegx commented 1 year ago

Hi!

What I'm doing wrong, to get this error?

[vite] Internal server error: render is not a function
at handleSsrRequest (/.../vue3/node_modules/vite-ssr/dev/server.js:105:34)
phlegx commented 1 year ago

Solved!

In main.js the default export should be the return of viteSSR().

export default viteSSR(App, { routes }, (context) => {
  /* Vite SSR main hook for custom logic */
  /* const { app, router, initialState, ... } = context */
})