-
Notifications
You must be signed in to change notification settings - Fork 755
Javascript runtime required in production #886
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
Comments
I'll look into it, fair point that it shouldn't be needed server-side if it's already compiled. Some of these things are specific to sprockets support so it may be related. The readme should say that TheRubyRacer should NOT be used, react does not work on libV8 less than ~v5 and TheRubyRacer is stuck on libV8 ~v3. If you need one, miniracer is the current best. |
Thank you so much. Ideally, I would not want include any of javascript runtime gems at all. |
Btw ... It works if I don't remove |
This is because react-rails always require execjs - see https://github.com/reactjs/react-rails/blob/v2.4.7/lib/react/jsx.rb#L1 |
Nice find @chulkilee . Do you there's a chance for PR to require on first use? Or perhaps with Rails autoloading, we could remove the requires altogether: |
I haven't investigated far enough. Even react-rails try to avoid loading @AirWick219 you may use multi stage docker build to include nodejs in build step, and do not include nodejs in runtime. That works for other asset-related gems requiring nodejs (e.g. |
ENV EXECJS_RUNTIME=Disabled Is probably what you want |
When requesting the app, execjs starts and nodejs processes start working for a long time, I am not sure if it actually rebuild the assets at production server?? How can I prevent this? Can you please check here: I tried |
@hopewise Closing the issue. Feel free to reopen if you are still facing the problem. |
System configuration
Sprockets or Webpacker version: webpacker ^3.3.1
React-Rails version: 2.4.4
Rect_UJS version: ^2.4.4
Rails version: ~> 5.1
Ruby version: 2.4.1
Just added react-rails to our app and we are trying to compile the assets with docker for porduction
We encounter this JavaScript runtime error when trying to start the server. But this error goes away if I add
gem 'therubyracer'
to my gem file. My question is do we absolutely needtherubyracer
gem even if we are not doing any server side rendering ?? Not sure if i miss it in the readme somewhere.The text was updated successfully, but these errors were encountered: