Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with deploy on production #304

Open
nepobo opened this issue Jul 6, 2023 · 6 comments
Open

Problem with deploy on production #304

nepobo opened this issue Jul 6, 2023 · 6 comments

Comments

@nepobo
Copy link

nepobo commented Jul 6, 2023

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.

@Faq
Copy link

Faq commented Jul 6, 2023

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
Copy link
Author

nepobo commented Jul 7, 2023

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
Copy link
Author

nepobo commented Jul 12, 2023

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

@aneshodza
Copy link

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
Copy link

jasonfb commented Oct 7, 2023

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
Copy link

HeitorMC commented Feb 23, 2024

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 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants