-
-
Notifications
You must be signed in to change notification settings - Fork 483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With nuxt-i18n upgrade from v6.3 to v6.13.12, other plugins are no longer available #874
Comments
problem is in we need to load translations with $axios, is there any chance to have plugins loaded in this time? ($axios mostly) |
I know what the issue is. The plugin system in nuxt is pretty annoying in being a bit unspecified regarding the order... |
Fix released in v6.15.1 |
This "fix" breaks the documented behavior described here: https://i18n.nuxtjs.org/api#extension-of-nuxt-context. Simple example:
In 6.15.0 the above work ok. |
There is no way to make the order work for all cases. If there are only modules at play then the plugin registration order is opposite of the module registration order (since adding plugin from a module adds it at the start of the list). If there are also "loose" plugins mixed into the picture then I'm not sure what is currently the order but judging from your comment, the "loose" plugins are registered before modules so run first. In your case, you should probably create a simple module that adds the plugin using This fix was to make the order predictable within modules registration. |
In fact this is exactly what is done in my case. I have the code I gave as example in a plugin loaded by module and that module is listed after nuxt-i18n in nuxt.config.js / modules... |
Should be listed before nuxt-i18n. As I've said, plugins are registered in opposite order than modules themselves. Blame Nuxt. |
Thanks for pointing that out since I did not get it the first time. :) |
Version
nuxt-i18n: 6.13.12
nuxt: 2.14.3
Nuxt configuration
Nuxt-i18n configuration
Steps to reproduce
What is Expected?
As expected with nuxt-i18n 6.3, plugin (ctx.app.$logger) is available during lazy load on server side.
What is actually happening?
Plugin is not available during lazy load on server side.
Regards
The text was updated successfully, but these errors were encountered: