basecamp / trix

A rich text editor for everyday writing
https://trix-editor.org/
MIT License
19.16k stars 1.12k forks source link

RoR 7 : action_text toolbar and text not displayed - promise error in console.log #1182

Open phytodia opened 3 months ago

phytodia commented 3 months ago

Hi, since one week and maybe after switch from cloudinary to s3, my action_text toolbar is not displayed and my text is hidden or not clickable. I have in console.log few errors like this :

Uncaught TypeError: Cannot read properties of undefined (reading 'Promise') at trix-df2bf484e34719e3b4933ba6bc3139eb1e7ad4fbbedb13bbd04be4d80b42664a.js:6:3008 at trix-df2bf484e34719e3b4933ba6bc3139eb1e7ad4fbbedb13bbd04be4d80b42664a.js:6:3031

jhysek commented 3 months ago

Same issue here. I've created a minimal example https://github.com/jhysek/trix-error-example if someone needs to reproduce the issue.

thomas6791 commented 3 months ago

The problem comes probably from importmap. It works when i use javascript include_tag 'trix'

jslipak commented 2 months ago

I encountered the same issue. As a temporary workaround, I added the following code to: app/views/layouts/application.html.erb:

<head>
    ...
    <!-- BUG: Trix problem Issue Open https://github.com/basecamp/trix/issues/1182 -->
    <link rel="stylesheet" type="text/css" href="https://unpkg.com/trix@2.0.8/dist/trix.css">
    <script type="text/javascript" src="https://unpkg.com/trix@2.0.8/dist/trix.umd.min.js"></script>
  </head>

Best regards Jonathan.