tinymce-rails icon indicating copy to clipboard operation
tinymce-rails copied to clipboard

Problem with deploy on production

Open nepobo opened this issue 1 year ago • 6 comments

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 function min` 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.

nepobo avatar Jul 06 '23 11:07 nepobo

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?

Faq avatar Jul 06 '23 14:07 Faq

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 avatar Jul 07 '23 05:07 nepobo

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

nepobo avatar Jul 12 '23 12:07 nepobo

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

aneshodza avatar Sep 08 '23 14:09 aneshodza

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

jasonfb avatar Oct 07 '23 18:10 jasonfb

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:

HeitorMC avatar Feb 23 '24 20:02 HeitorMC