Symfony – XXX is not a constructor

I am trying to install Jodit (https://xdsoft.net/jodit/doc/) on my Symfony project

I use webpack-encore, so, in my app.js, I added:

// Jodit

const Jodit = require("jodit");
global.Jodit = Jodit;

And in my template :

<script>
        var editor = new Jodit('#message_content', {
            "minHeight": 200,
            "showCharsCounter": false,
            "toolbarAdaptive": false,
            "showWordsCounter": false,
            "showXPathInStatusbar": false,
            "defaultActionOnPaste": "insert_clear_html",
            "buttons": "bold,italic,underline,strikethrough,|,ul,ol,|,font,fontsize,|,image,video,table,link,|,left,center,right,|,hr,symbol,|,undo,redo"
        });
    </script>

But I get:

Jodit is not a constructor

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *