inertia
inertia copied to clipboard
Vue SSR - TypeError: createServer is not a function
Versions:
- @inertiajs/inertia version: 0.11.1
- @inertiajs/inertia-vue3: ^0.6.0
- @inertiajs/server: ^0.1.0
- @vue/server-renderer": "^3.2.40
- vue: ^3.2.40
- vite: ^3.0.0
Describe the problem:
Getting error "TypeError: createServer is not a function" while trying SSR from import createServer from '@inertiajs/server package.
Steps to reproduce:
- Followed the steps for server side setup provided by the documentation
- Execute command
vite build --ssr --outDir public/build/server - Execute command
node public/build/server/ssr.mjs
This solved it for me:
https://github.com/inertiajs/server/issues/10#issuecomment-1208751934
are you sure that you exclude in ssr.external = @inertia/server?
Thanks @amiranagram and @KimhoutSam for your help here.
Going to close this one since @ramonmalcolm10 hasn't responded, and I don't think there is actually a bug here.