symfony / ux

Symfony UX initiative: a JavaScript ecosystem for Symfony
https://ux.symfony.com/
MIT License
814 stars 298 forks source link

[TURBO] wysiwyg problem on first page load #1481

Open radiz13 opened 7 months ago

radiz13 commented 7 months ago

Hi ! I've a problem with Turbo and wysiwyg editors (tried FOSCKEditor bundle & Quill). After removing cache, on first load, I've an error "Uncaught ReferenceError: CKEDITOR is not defined". The editor only loads on page refreshes. Has anyone ever encountered this issue before? Thx.

Uncaught ReferenceError: CKEDITOR is not defined
    renderElement https://***.wip/assets/vendor/@hotwired/turbo/turbo.index-810f44ef1a202a441e4866b7a4c72d11.js:21
    assignNewBody https://***.wip/assets/vendor/@hotwired/turbo/turbo.index-810f44ef1a202a441e4866b7a4c72d11.js:21
    replaceBody https://***.wip/assets/vendor/@hotwired/turbo/turbo.index-810f44ef1a202a441e4866b7a4c72d11.js:21
    ...
WebMamba commented 7 months ago

I think it's maybe because the CKEDITOR is used before being instantiated, so my better guess is maybe because your javascript files are not loaded on the good orders. Because turbo doesn't reload your javascript when you reload the page your CKEDITOR is now instantiated and this is why It's working on page reload. Do you see what I mean?

radiz13 commented 6 months ago

Thx for your reply. The ploblem is that CKEDITOR is used by the bundle FOSCKEDITOR, so I don't think I can do anything with priorities ? (I don't import CKEDITOR in importmap.php or app.js) Difficult to understand why it works after a first refresh... no answer for the moment...

carsonbot commented 3 weeks ago

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot commented 1 week ago

Hello? This issue is about to be closed if nobody replies.