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

Issue with SSR when using Rails & React #378

Open
svetliomihailov opened this issue May 23, 2020 · 0 comments
Open

Issue with SSR when using Rails & React #378

svetliomihailov opened this issue May 23, 2020 · 0 comments

Comments

@svetliomihailov
Copy link

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. The steps to run the project and reproduce the issue are in the README file.

Expected behavior:

To be able to see the rendered component

Actual behavior:

The result is the following error:

Encountered error "#<ExecJS::ProgramError: Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.>" 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 <anonymous> ((execjs):52906:8), <anonymous>:6:45)
eval (eval at <anonymous> ((execjs):52906:8), <anonymous>:18:13)
(execjs):52906:8
(execjs):52912:14
(execjs):1:40
Object.<anonymous> ((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'
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

1 participant