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

Server-side Rendering with React Components (Hybrid approach) #572

Closed
kumarrk5 opened this issue Jul 16, 2018 · 4 comments
Closed

Server-side Rendering with React Components (Hybrid approach) #572

kumarrk5 opened this issue Jul 16, 2018 · 4 comments

Comments

@kumarrk5
Copy link

I am trying to setup asp.net core project with server-side rendering concept using react components(Hybrid way).

I can't use third party libraries in server-side rendering.
for example, https://reactstrap.github.io/ library throws this error.

"React.Exceptions.ReactScriptLoadException: Error while loading "~dist/server.bundle.js": Script Document [2]: Uncaught ReferenceError: Map is not defined at line: 2880 column: 69.
Line: 2880"

I attached the relevant screenshots here. please check this. Did I miss anything ?

error:

error

package file:

package file

server-side component call in home view

server-side component call in home view

startup file register

startup file register

webpack config

webpack config

expose-loader

expose-loader

mapping of server-side rendering

mapping of server-side rendering

@dustinsoftware
Copy link
Member

dustinsoftware commented Jul 16, 2018 via email

@kumarrk5
Copy link
Author

https://github.com/Taritsyn/JavaScriptEngineSwitcher/wiki/Registration-of-JS-engines

I followed above link to add JS engine, but i got another issue Now i got this error
"HTTP Error 502.3 - Bad Gateway"
Can you please some other link to resolve this issue ? or some steps ...

Refer these screenshots...

error
error1

@dyamon-cz
Copy link

Solution is to install ChakraCore NuGet package. Follow the steps in the documentation here https://reactjs.net/guides/chakracore.html.

@dustinsoftware
Copy link
Member

You can check out the samples in this repo, they should all be working. At this point it doesn’t seem like this is a library bug so I’m closing this issue.. let me know if you have trouble getting the samples to run.

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

3 participants