Ask A Question

Notifications

You’re not receiving notifications from this thread.

Trix editor is not displaying properly in Rails 6

Rajiv asked in Rails

Hello - I have installed Action Text in my Rails 6 app and made corresponding changes to my blog / controller, form to have rich_text_area show. Problem is that despite requiring actiontext in my application.scss - the Trix toolbar is not rendering properly. As in it is a long bar. Have now tried multiple combinations of requiring actiontext - but nothing seems to work.

In application.js :
require("@rails/activestorage").start(); is giving an error - Could not find a declaration file for module '@rails/activestorage'. .../node_modules/@rails/activestorage/app/assets/javascripts/activestorage.js' implicitly has an 'any' type.
Try `npm install @types/rails
_activestorageif it exists or add a new declaration (.d.ts) file containingdeclare module '@rails/activestorage';`ts(7016).
Similarly, require("trix"); and require("@rails/actiontext"); are giving similar errors. What should I do to make this run properly. Any help will be greatly appreciated.
Thank you!

Reply

Try upgrading your @rails/webpacker package to the latest version, v5.2.1.

Reply

Thank you Drew for your response. I did update webpacker, but the error persists.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.