GENL / matice

Use your Laravel translations in JavaScript.
MIT License
98 stars 14 forks source link

Bug with inertia SSR #47

Open sbc640964 opened 2 weeks ago

sbc640964 commented 2 weeks ago

Versions

Bug

This package is not working on ssr (inertia ssr)

The commands I ran

npm run build // vite build && vite build --ssr
php artisan matice:generate
php artisan inertia:start-ssr

//Result:
Starting SSR server on port 13714...
Inertia SSR server started.
ReferenceError: Matice is not defined
    at new Localization (/home/sbc/Documents/Projects/ad-sheyovo/node_modules/matice/dist/Localization/core.js:26:53)
    at Function.get (/home/sbc/Documents/Projects/ad-sheyovo/node_modules/matice/dist/Localization/core.js:35:42)
    at __ (/home/sbc/Documents/Projects/ad-sheyovo/node_modules/matice/dist/Localization/core.js:235:25)
    at Front (file:///home/sbc/Documents/Projects/ad-sheyovo/bootstrap/ssr/assets/Front-b140ac4a.js:52:23)
    at renderWithHooks (/home/sbc/Documents/Projects/ad-sheyovo/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:5662:16)
    at renderIndeterminateComponent (/home/sbc/Documents/Projects/ad-sheyovo/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:5735:15)
    at renderElement (/home/sbc/Documents/Projects/ad-sheyovo/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:5950:7)
    at renderNodeDestructiveImpl (/home/sbc/v/Projects/ad-sheyovo/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:6108:11)
    at renderNodeDestructive (/home/sbc/Documents/Projects/ad-sheyovo/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:6080:14)
    at renderContextProvider (/home/sbc/Documents/Projects/ad-sheyovo/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:5924:3)
sbc640964 commented 2 weeks ago

?

GENL commented 2 weeks ago

Thanks for reporting this. I'll take a look at it,

Le jeu. 29 août 2024 à 09:08, sbc640964 @.***> a écrit :

?

— Reply to this email directly, view it on GitHub https://github.com/GENL/matice/issues/47#issuecomment-2316973765, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIZIVDQLXUQ6D6JXX7JU2QDZT3JITAVCNFSM6AAAAABNHU3WVGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJWHE3TGNZWGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>