rawilk / laravel-form-components

Form components built for Tailwind & Livewire.
https://randallwilk.dev/docs/laravel-form-components
MIT License
386 stars 42 forks source link

Quill Not Defined #67

Closed abbasmashaddy72 closed 1 year ago

abbasmashaddy72 commented 1 year ago

Laravel Form Components Version

7.1

Laravel Version

9.19

Alpine Version

3.4.2

Bug description

Errors: Uncaught ReferenceError: quill is not defined

Uncaught ReferenceError: value is not defined

Warning: Alpine Expression Error: quill is not defined

Alpine Expression Error: value is not defined

Steps to reproduce

Installed Latest Laravel Project using with vite

Followed the instruction given in Docs.

Tried 2 Methods of import of quill, but none works, same issue returns

Please Check for logs Below Please Not I am not using the Vue it is just the extension from Chrome.

npc.test-1669704065994.log

Relevant log output

The Log Output File has been Provided Above.
tweekah commented 1 year ago

Having the same issue, any fixes jet?

tweekah commented 1 year ago

Problem is with webpack, L9 uses vite as default so form-components.js is not loaded.

tweekah commented 1 year ago

Seem to have found a solution for now; add './vendor/rawilk/laravel-form-components/dist/form-components.js', to the laravel input plugins of your vite config, then add @vite('vendor/rawilk/laravel-form-components/dist/form-components.js') to your blade view where you're using the form components

rawilk commented 1 year ago

You shouldn't need to resort to adding the package's JS files to your build pipeline, even in v7. I've never had an issue myself loading the package's scripts alongside of using vite in a laravel app.

I've released v8 of the package today, which I know for sure works in a Laravel 10.x app that uses vite, since I used a brand new app to test it out as I was developing the new release. I've also changed the build process for the package's scripts from webpack to rollup, but that really shouldn't make a difference.

I'm going to close this issue, but feel free to re-open if you're still having issues with this.