julianpoemp / ngx-jodit

Angular wrapper for jodit and jodit-pro WYSIWYG editor supporting Angular >=12 and ESM.
https://github.julianpoemp.com/ngx-jodit/3.x/
MIT License
17 stars 4 forks source link

ngx-jodit-pro: Icons are not being rendered #8

Closed vitorlopez closed 1 year ago

vitorlopez commented 1 year ago

So I'm using ngx-jodit-pro in an app with Angular 16 + esbuild and I noticed the icons aren't being rendered correctly: image

I'm also having problems making the plugins to work, for example the page-break plugin. This is my angular.json:

"styles": [
                    (...)
                    "./node_modules/jodit-pro/es2021/jodit.fat.min.css"
                ],
                "scripts": [
                    "./node_modules/jodit-pro/es2021/jodit.js",
                    "./node_modules/jodit-pro/es2021/plugins/page-break/page-break.js"
                ]

I think I'm importing everything it needs but for some reason still not rendering the icons and the plugins are not working. Let me know if you need more info to reproduce it. But I have a very basic example in my code.

// options: "buttons": "bold,italic,underline", 
<ngx-jodit-pro
                            *ngIf="value"
                            [(value)]="value"
                            [options]="options"
                        />

Am I missing something in this setup?

vitorlopez commented 1 year ago

Update: If I downgrade to "3.0.0-beta.0 I can see the icons again but then I see a new error:

image

zone.js:1029 Uncaught TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Event'
    --- property 'originalEvent' closes the circle
    at JSON.stringify (<anonymous>)
    at readableObjectToString (zone.js:1029:63)
    at resolvePromise (zone.js:1193:69)
    at zone.js:1100:17
    at zone.js:1116:33
    at _ZoneDelegate.invoke (zone.js:368:26)
    at Object.onInvoke (core.mjs:26321:33)
    at _ZoneDelegate.invoke (zone.js:367:52)
    at _Zone.run (zone.js:129:43)
    at zone.js:1257:36
zone.js:1029 Uncaught TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Event'
    --- property 'originalEvent' closes the circle
    at JSON.stringify (<anonymous>)
    at readableObjectToString (zone.js:1029:63)
    at resolvePromise (zone.js:1193:69)
    at zone.js:1100:17
    at zone.js:1116:33
    at _ZoneDelegate.invoke (zone.js:368:26)
    at Object.onInvoke (core.mjs:26321:33)
    at _ZoneDelegate.invoke (zone.js:367:52)
    at _Zone.run (zone.js:129:43)
    at zone.js:1257:36
julianpoemp commented 1 year ago

thank you for reporting this issue! I solved it by reverting the commit related to typings for options. I thought I could use typings from the Jodit package but this caused the problem.

I just released 3.0.0-beta.2 which should fix this issue 😄

vitorlopez commented 1 year ago

That fixed my issue, thanks again @julianpoemp !