i18n inside plugin
How to access the I18n instance inside a plugin?
I have a plugin that fetches global data for my app from a backend, and I need to use the locale.
I cant import it from the composable...
error caught during app initialization SyntaxError: Must be called at the top of a setup function
... Even though the plugin is inside a setup
function...
I can't use use it from nuxtApp, because I18n is not there yet...
(This solution is inconsistent in development, but fails 100% in production.)
How do I make sure i18n is loaded before my plugin?2 Replies
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
Thanks for the reply!
I had to change enforce to 'post', and that was enough to fix it