xiCO2k / laravel-vue-i18n

Allows to connect your `Laravel` Framework translation files with `Vue`.
MIT License
599 stars 49 forks source link

can't use with SSR because direct access to document property #3

Closed ibrunotome closed 2 years ago

ibrunotome commented 2 years ago

Hi.

If you try to build to server to get SSR, you will find this error:

Screen Shot 2022-01-10 at 09 49 02

A possible fix is check if the build is running for server or for browser: https://github.com/inertiajs/inertia/blob/master/packages/inertia/src/router.ts#L10

And only access the document property if is it running on browser.

ibrunotome commented 2 years ago

Also: after upgrade from 0.2.1 to 0.4.1:

Uncaught SyntaxError: The requested module '/node_modules/.vite/laravel-vue-i18n.js?v=4bc78461' does not provide an export named 'i18nVue'

This happened with v3 also, rolling back to 0.2.1 it works again.

xiCO2k commented 2 years ago

Hey @ibrunotome, I will work on SSR support.

Thanks for the notice.

xiCO2k commented 2 years ago

v0.5.0 should have the support for the SSR.

Let me know if that works.

ibrunotome commented 2 years ago

v0.5.0 should have the support for the SSR.

Let me know if that works.

yep, builded successfully. Thank you!

xiCO2k commented 2 years ago

Awesome! let me know about the export named issue