Skip to content

Commit 5106627

Browse files
committed
fix(plugin): WARN: Plugin has already been applied to target app. #1
1 parent 4743cdf commit 5106627

File tree

4 files changed

+6
-59
lines changed

4 files changed

+6
-59
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
3535
},
3636
"dependencies": {
37-
"@formkit/nuxt": "^1.6.7",
3837
"@nuxt/kit": "^3.14.0",
3938
"@nuxtjs/i18n": "^8.5.6",
4039
"@primevue/nuxt-module": "^4.2.1",

pnpm-lock.yaml

Lines changed: 0 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export default defineNuxtModule<ModuleOptions>({
4747
const resolver = createResolver(import.meta.url)
4848
await installModule('@primevue/nuxt-module')
4949
await installModule('@nuxtjs/i18n')
50-
await installModule('@formkit/nuxt')
5150

5251
const css: string[] = _nuxt.options.css ?? []
5352
if (_options.includePrimeIcons) {

src/runtime/plugin.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { primeInputs, primeOutputs, usePrimeInputs } from '@sfxcode/formkit-prim
22
import { addPrimeAsteriskPlugin } from '@sfxcode/formkit-primevue/plugins'
33
import { createAutoAnimatePlugin } from '@formkit/addons'
44
import { de, en, es, fr } from '@formkit/i18n'
5-
import { defaultConfig, plugin } from '@formkit/vue'
5+
import { defaultConfig, plugin, ssrComplete, resetCount } from '@formkit/vue'
66
import type { FormKitPlugin } from '@formkit/core'
77
import { useRuntimeConfig } from '#app/nuxt'
88
import { defineNuxtPlugin } from '#app'
@@ -45,4 +45,9 @@ export default defineNuxtPlugin((_nuxtApp) => {
4545
plugins: formkitPlugins,
4646
}))
4747
}
48+
49+
_nuxtApp.hook('app:rendered', () => {
50+
resetCount()
51+
ssrComplete(_nuxtApp.vueApp)
52+
})
4853
})

0 commit comments

Comments
 (0)