andrewcloss's avatar

CKEditor5 not loading with Mix

Hi folks, I'm trying to load CKEditor5 in my view however the Mix is not loading the package properly.

package.json

"dependencies": { "@ckeditor/ckeditor5-build-classic": "^19.0.0" }

editor.js

require('@ckeditor/ckeditor5-build-classic');

webpack.mix.js

mix.js('resources/js/editor.js', 'public/js');

edit.blade.php

<script src="{!! mix('js/editor.js') !!}"></script>
<script>
ClassicEditor
        .create( document.querySelector( '#editor' ), {
            plugins: [ ]
         } )
        .then( editor => { } )
        .catch( error => {
                console.error( error );
        } );
</script>

I get:

Uncaught ReferenceError: ClassicEditor is not defined

In my Network tab, the 'editor.js' is loaded. Here is the pastebin (minus the minified code, too big for pastebin): https://pastebin.com/iAh2Y95c

0 likes
0 replies

Please or to participate in this conversation.