TrestleAdmin / trestle-tinymce

TinyMCE integration plugin for the Trestle admin framework
https://trestle.io
GNU Lesser General Public License v3.0
12 stars 1 forks source link

Uncaught TypeError: Cannot read properties of undefined (reading 'dom') #10

Open rpatil opened 2 years ago

rpatil commented 2 years ago

After clicking on the source-code button of the editor, the complete text vanishes.

Gem details:

gem 'trestle', '0.9.2' gem 'trestle-auth', '0.3.0' gem 'trestle-search', '0.4.1' gem 'trestle-tinymce', '0.3.1' gem 'tinymce-rails', '5.10.1'

Step 1:

Screenshot 2021-12-10 at 6 41 34 PM

Step 2:

Screenshot 2021-12-10 at 6 39 17 PM
dongalor commented 2 years ago

I'm having same problem, but only in production. Running it locally in development environment works like a charm. So, it looks like after precompiling assets something goes wrong.

denisse-orellana commented 2 years ago

For those who have this problem in production, I recommend you to change in production.rb:

config.assets.js_compressor = :uglifier

To:

config.assets.js_compressor = Uglifier.new(harmony: true)

Also, delete cache and everything. Try it in different browsers. (You can use the gem Terser too as a JavaScript compressor).

I hope this can be helpful, I've spent days trying to understand the problem.