filament-editorjs icon indicating copy to clipboard operation
filament-editorjs copied to clipboard

Alpine Expression Error: editorjs is not defined

Open Rudston opened this issue 2 years ago • 1 comments

Hello, I am getting the above error.

Alpine.start() is called in my app.js

It seems that the listener document.addEventListener("alpine:init", () => { Alpine.data( "editorjs",

Only gets set after that so it does not get triggered and as a result editorjs is not available...? Grateful for any assistance.

"filament/filament": "^2.16", "filament/forms": "^2.0", "livewire/livewire": "^2.10", "laravel/framework": "^9.19",

Rudston avatar Feb 22 '23 08:02 Rudston

In case useful, from @rhmrms on Discord:

  1. Publish assets
php artisan vendor:publish --provider="FilamentEditorJs\FilamentEditorJsServiceProvider" --tag="filament-editorjs-assets"
  1. Add style in layout
<link href="{{ asset('vendor/filament-editorjs/css/editor.css') }}" rel="stylesheet">
  1. Add scripts before Alpine
<script src="{{ asset('vendor/filament-editorjs/js/editor.js') }}"></script>

CeriseGoutPelican avatar Apr 02 '23 16:04 CeriseGoutPelican