Laravel CKEditor5 – ClassicEditor is not Defined

I’m trying to replace an old version of CKEditor in a Laravel app due to dependency incompatibility with unisharp/laravel-ckeditor and Laravel 6. I’ve found the CKEditor 5 page with NPM installation instructions, but haven’t been able to get it working. Here is my code:





mix.js('resources/assets/js/main.js', 'public/js');


<!doctype html>
  <script src="{{ asset('js/main.js') }}"></script>

jQuery is included (somehow; somewhat unfamiliar with webpack), but running a page that extends @extends('layouts.master') results in the following:

Uncaught ReferenceError: ClassicEditor is not defined

If I remove the require() statement from main.js and simply use the CDN link, everything works as expected:

<script src=""></script>
<script src="{{ asset('js/main.js') }}"></script>

I’m doing something wrong, but I’m at a loss… Has anyone seen this issue before?


Quite a simple solution that the documentation fails to reference, but you need to assign the value of require() to ClassicEditor:

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

Doing so allows correct reference in code.