You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been attempting to perform server-side rendering of mui (formerly material-ui) components and have been getting issues similar to #193. The precise error I am getting is
ActionView::Template::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 MaterialComponentList with {}
I was wondering whether the state of the art has changed with regards to using server-side rendering. For the sake of example, I am using a modified form of this in this gist
I'm on rails 6.1.4.4 with Ruby 3.0 and reasct-rails 2.6.1.
If it would be helpful I can spin up and post a minimal example.
The text was updated successfully, but these errors were encountered:
I have been seeing this as well. Unfortunately all I have been able to come up with is to avoid server-side rendering for the components that give me this error... I am wondering what the underlying cause is too
.
I had that issue before, like the error states, you are passing in undefined when your prop expects a string or a function. Check your life cycle and all your variables to see which one get's inside undefined. Prerendering happens before viewing the page so window and document variables are undefined as well.
Also try to use functional components, class components are heavier and it could be causing the pre-render to fail.
I have been attempting to perform server-side rendering of
mui
(formerly material-ui) components and have been getting issues similar to #193. The precise error I am getting isI was wondering whether the state of the art has changed with regards to using server-side rendering. For the sake of example, I am using a modified form of this in this gist
I'm on rails 6.1.4.4 with Ruby 3.0 and reasct-rails 2.6.1.
If it would be helpful I can spin up and post a minimal example.
The text was updated successfully, but these errors were encountered: