spohlenz / tinymce-rails

Integration of TinyMCE with the Rails asset pipeline
Other
813 stars 256 forks source link

Problem with deploy on production #304

Open nepobo opened 12 months ago

nepobo commented 12 months ago

I use last version this gem. Tinymce work fine on stage. When i deploy on production, i get error: rake aborted! SassC::SyntaxError: Error: "calc(100vh - 110px)" is not a number for min' on line 1:30571 of stdin, in functionmin` from line 1:30571 of stdin

x;flex:1;flex-direction:column;max-height:min(650px,calc(100vh - 110px));ove

I found that this bad for my prefixer code in tinymce/skins/ui/oxide/skin.min.css. I try change version of prefixer, but is not solve problem. I have ruby version 2.6.0 , autoprefixer-rails 10.4.13, nodejs autoprefixer: "9.8.8". Maybe somebody know how i can solve this problem.

Faq commented 12 months ago

Well, there is no such thing as last version as it can change every day. Rails, Sprocket version? dart saas? This problem not occurs on dev environment?

nepobo commented 12 months ago

tinymce-rails 6.5.1 Rails 6.0.6.1 Sprocket 4.2.0 sprockets-rails 3.4.2 sass-rails (6.0.0) dartsass-rails - not installed Problem occurs only on stage environment and production I run on development environment: rake assets:precompile and all compiled successfully.

nepobo commented 11 months ago

I solve this problem adding config.tinymce.install = :copy in config/application.rb In next time will read documentation more mindfully

aneshodza commented 10 months ago

Getting the same issue when running it with :compile. When I try to run it with :copy I get:

The resource from “https://[ommited]/assets/tinymce/plugins/paste/plugin.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

And before that:

GET | https://[omitted]/assets/tinymce/plugins/paste/plugin.js
status 404 not found
jasonfb commented 9 months ago

I'm seeing the same behavior in my test environments only. Specifically, my test fails with but testing locally, TinyMCE works fine.

 1) interaction for Admin::UsersController index should show me the list
     Failure/Error: Unable to find stdin to read failed line

     ActionView::Template::Error:
       Error: "calc(100vh - 110px)" is not a number for `min'
               on line 1:30534 of stdin, in function `min`
               from line 1:30534 of stdin
       >> x;flex:1;flex-direction:column;max-height:min(650px,calc(100vh - 110px));ove
          ------------------------------------------^
     # stdin:1
     # ------------------
     # --- Caused by: ---
     # SassC::SyntaxError:
     #   Error: "calc(100vh - 110px)" is not a number for `min'
     #           on line 1:30534 of stdin, in function `min`
     #           from line 1:30534 of stdin
     #   >> x;flex:1;flex-direction:column;max-height:min(650px,calc(100vh - 110px));ove
     #      ------------------------------------------^
     #   stdin:1
HeitorMC commented 4 months ago

Hey guys!

I recently added tinymce-rails latest version to my project and it's working fine in the development environment. However, after deploying to staging or production stop working for some reason. At first, I tried using this approach:

<%= tinymce_assets %>
#=> <script type="text/javascript" src="/assets/tinymce.js">

But it didn't work, so I changed to the this approach:

added this line in my application.js

//= require tinymce

added this into my layout.erb

<%= javascript_include_tag 'tinymce' %>

and finally added this line to this config:

Rails.application.config.assets.precompile += %w[
  tinymce.js
]

It works like a charm on development, but when it goes to staging/prod, the rich text doesn't load and throws those errors on console:

image

Any idea on how to solve this? I'm using rails - 5.2 webpacker - 3.6.0

UPDATE 02-26-2024

I had an issue with my webpacker config. After solving this issue, just run bundle exec rails assets:precompile :tada: