How to run nuxtClientInit after plugins initialized ?
See original GitHub issueMy client intialization code use plugins, and I got errors like this
TypeError: this.$myPlugin is not a function
It is possible to run nuxtClientInit after plugins initialized ?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6
Top Results From Across the Web
Plugins directory - Nuxt
The plugins directory contains your Javascript plugins that you want to run before instantiating the root Vue.js Application.
Read more >Init nuxt plugins once instead of server + client - Stack Overflow
This works fine. However, both plugins are initialized twice, first from the server, then from the client, which I noticed because of 2...
Read more >How to properly initialize app under SPA mode? #2660 - GitHub
I have an initialization issue using Nuxt on SPA mode. ... plugins (execute once before app loads); fetch (to init $store with server...
Read more >Nuxt.js initialization - Mercari Engineering Blog
I'll use .nuxt-dev/client.js here, as it's easier to explain while looking at the code. The following code represents only what's needed to ...
Read more >How to create a global custom plugin in Nuxt.js
Building the component · The store · Subscribe the component to the store · Initialize the plugin · Define and register the plugin...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I had a similar issue. Nuxt is supposed to load the modules in the order based on the nuxt.config file. However, in my case, the order was completely different. If you really need to wait for the initialization, the quickest way to achieve this, is to call emulate
nuxtClientInityourself.For example:
https://github.com/therealwolf42/nuxt-socket.io-module/blob/master/lib/plugin.js#L20
The solution by @therealwolf42 successfully works in my case. Loaded it as a plugin and gives access to all the needed plugin variables in a custom init method.