jossmac / jossmac/react-images
Issue with SSR when using Rails & React
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 433
- PR merge metrics
- No merged PRs in 30d
Description
Hello, thank you very much for creating & maintaining this library!
It's awesome and I use it in all of my projects at work :)
I'm having an issue with Server side rendering with the latest versions.
The problem first shows up in version `1.1.3`. In version `1.1.2` the issue is not present.
**Steps to reproduce the behavior:**
Here is a repo with an example [Rails project](https://github.com/jossmac/react-images/issues/new). The steps to run the project and reproduce the issue are in the [README](https://github.com/svetliomihailov/react-images-rails-ssr-issue/blob/master/README.md) file.
**Expected behavior:**
To be able to see the rendered [component](https://github.com/svetliomihailov/react-images-rails-ssr-issue/blob/master/app/javascript/components/Gallery.jsx)
**Actual behavior:**
The result is the following error:
```
Encountered error "#" when prerendering Gallery with {}
ReactDOMServerRenderer.render ((execjs):10837:21)
ReactDOMServerRenderer.read ((execjs):10488:33)
Object.renderToString ((execjs):11071:31)
Object.serverRender ((execjs):48838:42)
eval (eval at ((execjs):52906:8), :6:45)
eval (eval at ((execjs):52906:8), :18:13)
(execjs):52906:8
(execjs):52912:14
(execjs):1:40
Object. ((execjs):1:58)
/Users/svetlio/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:39:in `exec'
/Users/svetlio/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:21:in `eval'
/Users/svetlio/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/react-rails-2.6.1/lib/react/server_rendering/exec_js_renderer.rb:39:in `render_from_parts'
/Users/svetlio/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/react-rails-2.6.1/lib/react/server_rendering/exec_js_renderer.rb:20:in `render'
```
Contributor guide
Assessment
This issue has not been assessed yet.