inertia icon indicating copy to clipboard operation
inertia copied to clipboard

Vue SSR - TypeError: createServer is not a function

Open ramonmalcolm10 opened this issue 3 years ago • 1 comments

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

ramonmalcolm10 avatar Oct 02 '22 09:10 ramonmalcolm10

This solved it for me:

https://github.com/inertiajs/server/issues/10#issuecomment-1208751934

amiranagram avatar Oct 11 '22 13:10 amiranagram

are you sure that you exclude in ssr.external = @inertia/server?

SH8GH avatar Jan 18 '23 09:01 SH8GH

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.

reinink avatar Jan 18 '23 12:01 reinink