kartik-v / yii2-editors

Yii2 editor widgets Summernote and Codemirror.
Other
22 stars 7 forks source link

Cannot read property defaults of undefined - Summernote #3

Closed lubosdz closed 4 years ago

lubosdz commented 4 years ago

Prerequisites

Steps to reproduce the issue

Very basic setup:

$form->field($model, 'category_description')->widget(Summernote::class, [
    'options' => [
        'placeholder' => 'Edit your blog content here...',
    ]
])

Expected behavior and actual behavior

Wysiwyg will not initiate on textarea.

Received console error:

jquery.js:3850 Uncaught TypeError: Cannot read property 'defaults' of undefined
    at HTMLTextAreaElement.<anonymous> (kv-summernote.js:82)
    at Function.each (jquery.js:367)
    at jQuery.fn.init.each (jquery.js:202)
    at jQuery.fn.init.$.fn.kvSummernote (kv-summernote.js:79)
    at HTMLDocument.<anonymous> (list?cid=2:285)
    at mightThrow (jquery.js:3557)
    at process (jquery.js:3625)

Error in this line 82: https://github.com/kartik-v/yii2-editors/blob/master/src/assets/lib/js/kv-summernote.js#L82

Environment

Operating System

Libraries