ReactOnRails pre-rendering error after deploying new Ruby and Node versions with Capistrano

Our website is running Sharetribe Go with Puma & React on Rails to pre-render components. It has a TopBarApp component built by Sharetribe that displays top menus like Home, About, etc.

We recently upgraded the Ruby version from 2.6.2p47 to 2.6.5p114, and Node v7.8.0 to v10.15.3 (npm v6.4.1). After redeploying the new code with Capistrano, theTopbar no longer displays, and we can’t access many subpages in our website. We get error msg:

Error during failsafe response: ERROR in SERVER PRERENDERING when prerendering TopbarApp with props

(Full Puma error log | Full Puma access log)

This bug is generated when running the step deploy:assets:precompile with Capistrano deployment. I think have an issue when we build the code client for javascript (css files). Maybe it is not related to Ruby or Node version but something to do with memory when we build.

Checking Chrome developer console gives TypeError: s is not a function enter image description here

What we have tried

We tried to remove select nvm for Capistrano deployment. Our commit: enter image description here

However, the error is still there because SSH must set npm and node versions.

Anybody with a work-around?

Facing the same issue now after update to the newest version. Using foreman Procfile.static

Production works as before (Docker on Debian) but development stopped working with identical errors like above mentioned.

Environment: Mac M1, rbenv r2.7.5, node 10.15.3, npm 6.4.1 (via nvm).

Did you manage to fix it?