shentao / vue-multiselect

Universal select/multiselect/tagging component for Vue.js
https://vue-multiselect.js.org/
MIT License
6.66k stars 989 forks source link

SSR on Multiselect 3.0.0 import problem #1787

Open am54ful opened 3 weeks ago

am54ful commented 3 weeks ago

I'm running Vue-Multiselect 3.0.0 on Laravel 11. I simply using the basic syntax on documentation (copy and paste). I'm using Laravel inertia 1.2.0 on npm package and inertiajs/inertia-laravel on composer php also using node version 20.12.2. The problem is on SSR, it showed

SyntaxError: Cannot use import statement outside a module.

If I'm not turning on the SSR mode, it just went fine. Perhaps this is a bug because it is said to have SSR support officially. I expected no errors to happened, I noticed it like 2 weeks after production when migrating the app. Here's the picture for reference. I confirm problem is within the package as I removed some of the usage in my vue files, it just went gone. Just not sure how to repair.

Update: As I try to fix the issue, I update the file from vue-multiselect.esm.js to vue-multiselect.esm.mjs as well in its package.json file and it work as temporary solution.

Screenshot 2024-08-15 095535