File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -79,12 +79,15 @@ const module: NuxtModule<ModuleOptions> = defineNuxtModule<ModuleOptions>({
79
79
references . push ( { types : '@pinia/nuxt' } )
80
80
} )
81
81
82
- // Add runtime plugin
83
- if ( isNuxt2 ( ) ) {
84
- addPlugin ( resolver . resolve ( './runtime/plugin.vue2' ) )
85
- } else {
86
- addPlugin ( resolver . resolve ( './runtime/plugin.vue3' ) )
87
- }
82
+ // Add runtime plugin before the router plugin
83
+ // https://github.com/nuxt/framework/issues/9130
84
+ nuxt . hook ( 'modules:done' , ( ) => {
85
+ if ( isNuxt2 ( ) ) {
86
+ addPlugin ( resolver . resolve ( './runtime/plugin.vue2' ) )
87
+ } else {
88
+ addPlugin ( resolver . resolve ( './runtime/plugin.vue3' ) )
89
+ }
90
+ } )
88
91
89
92
// Add auto imports
90
93
const composables = resolver . resolve ( './runtime/composables' )
You can’t perform that action at this time.
0 commit comments