inertia icon indicating copy to clipboard operation
inertia copied to clipboard

SSR dont work

Open aetbaev opened this issue 1 year ago • 1 comments

How I can render on client?

Version:

  • @inertiajs/vue3 version: ^1.0.0

Describe the problem:

import require$$0 from "vue";
       ^^^^^^^^^^
SyntaxError: The requested module 'vue' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:122:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:188:5)
file:///public_html/bootstrap/ssr/assets/VueStarRating.common-57a657b1.mjs:1
import require$$0 from "vue";
       ^^^^^^^^^^
SyntaxError: The requested module 'vue' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:122:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:188:5)
client_loop: send disconnect: Broken pipe

Steps to reproduce:

npm install vue-star-rating@next
import StarRating from 'vue-star-rating'

<star-rating />

aetbaev avatar Oct 31 '23 15:10 aetbaev

This is an issue with the package you're trying to import by the looks of it.

vue-star-rating seems to include a default export of vue in its dist files. It's this that's breaking your build since Vue3 doesn't have a default export.

https://github.com/craigh411/vue-star-rating/blob/36f41ef79c928c29411e5240a31750b1e8414501/dist/VueStarRating.common.js#L588

craigrileyuk avatar Nov 09 '23 16:11 craigrileyuk