themesberg / flowbite-vue

Official Vue 3 components built for Flowbite and Tailwind CSS
https://flowbite-vue.com
MIT License
773 stars 120 forks source link

Global component import #193

Closed Sqrcz closed 1 year ago

Sqrcz commented 1 year ago

Hey,

Thanks for this Flowbite implementation...

🤞 that it will grow to be stable production ready thing... :)

I've tried to import component globally in main.ts but it gives me very hard to decode error...

import { createApp } from 'vue'
import { Button } from 'flowbite-vue'

import App from './App.vue'

import './assets/styles/index.css'

const app = createApp(App)

app.component('Button', Button)

app.mount('#app')

error:

[Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core 
  at <FlowbiteThemableChild tag="button" apply= (3) ['background', 'hover', 'focus'] class="text-white bg-blue-700 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg...

  Uncaught (in promise) RangeError: Maximum call stack size exceeded
    at callWithErrorHandling (runtime-core.esm-bundler.js:160:5)
    at setupStatefulComponent (runtime-core.esm-bundler.js:7236:25)
    at setupComponent (runtime-core.esm-bundler.js:7197:36)
    at mountComponent (runtime-core.esm-bundler.js:5599:7)
    at processComponent (runtime-core.esm-bundler.js:5565:9)
    at patch (runtime-core.esm-bundler.js:5040:11)
    at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5708:11)
    at ReactiveEffect.run (reactivity.esm-bundler.js:178:19)
    at instance.update (runtime-core.esm-bundler.js:5814:51)
    at setupRenderEffect (runtime-core.esm-bundler.js:5822:5)

Somewhere it loops infinitely... Importing component in every .vue file works... but i would like to avoid it as it would get very be tedious as app grows.

Ideally it would be great to import everything at once to be available inside whole project... I've tried to iterate over components... but I'm hitting the wall with above error.

cogor commented 1 year ago

Fixed in 0.0.17-next.6