ckeditor / ckeditor5-react

Official CKEditor 5 React component.
https://ckeditor.com/ckeditor-5
Other
426 stars 100 forks source link

Problem while using generalHTMLSupport & sourceEditing plugin #375

Closed shalapatil closed 1 year ago

shalapatil commented 1 year ago

Hello, I was facing similar problem like https://github.com/ckeditor/ckeditor5-react/issues/155 for generalHTMLSupport and sourceEditing plugin But when I add these two in plugins, I get Cannot read properties of undefined (reading 'generalHTMLSupport')

I am using custom ckeditor5 with react.

config is defined as const CKEDITOR_BASE_CONFIG_FOR_PRESETS = { plugins: [ window.CKEditor5.autoformat.Autoformat, window.CKEditor5.basicStyles.Bold, .......... window.Ckeditor5.generalHTMLSupport.GeneralHTMLSupport,], toolbar: {.....}`

Any help will be really appreciated. Thanks

Originally posted by @shalapatil in https://github.com/ckeditor/ckeditor5-react/issues/155#issuecomment-1540231361

Witoso commented 1 year ago

Hey! I see that you're most likely using the DLL approach. Are you sure you loaded the GeneralHTMLSupport via script tag or import?

shalapatil commented 1 year ago

I am following second approach (custom build) from this - https://www.thirdrocktechkno.com/blog/how-to-integrate-ckeditor5-in-strapi/ I have not imported it because, If I import it like following import GeneralHtmlSupport from '@ckeditor/ckeditor5-html-support/src/generalhtmlsupport'; it gives "ckeditor-duplicated-modules error".

if I don't import then I get - "Cannot read properties of undefined (reading 'generalHTMLSupport')" error

Witoso commented 1 year ago

It's a third-party integration, and I cannot help here a lot. As far as I can see those plugins are already added to this package, so I'm not sure why you need to load them. Consult maybe the developer of https://github.com/nshenderov/strapi-plugin-ckeditor/tree/master.

shalapatil commented 1 year ago

Okay, Thank you so much @Witoso !

shalapatil commented 1 year ago

Hello, I am using custom build created by ckeditor team only I have cloned https://github.com/ckeditor/strapi-plugin-ckeditor this and added my custom plugins there. I have posted same question on that repo as well but not getting any response from there.