Questions tagged [server-rendering]
63 questions
2
votes
2 answers
Conditional hooks when rendering static website
I'm using react-static to generate a static website. Using useLayoutEffect from the new hook API, I get this warning during the static rendering phase (same API as server-side rendering) :
Warning: useLayoutEffect does nothing on the server, because…

ostrebler
- 940
- 9
- 32
2
votes
3 answers
Any attributes to ensure an HTML form can't be submitted?
I want to server-render an HTML form in such a way that it is not submittable until it has been asynchronously enhanced by my JavaScript.
It looks like there's no disabled attribute for the form element (MDN).
I could add a disabled attribute to the…

callum
- 34,206
- 35
- 106
- 163
2
votes
0 answers
Server Side Rendering - ReactDOMServer.renderToString returns empty routes html (router 4)
I'm trying to render react application on server, but it seems that renderToString function doesn't render routes html only header and footer. By looking at the code of the page you can see only the header and footer that the server returned from…

Roman Fedchenko
- 41
- 1
- 5
2
votes
1 answer
Angular4 server side rendering with resolvind data
I am working on Angular4 project. I integrated server side rendering following this tutorial. Everything works, except one thing.
I need to change meta tags of page after data will be resolved from API server. I mean resolving like…

Albert
- 201
- 1
- 7
2
votes
1 answer
asyncLocalStorage requires a global localStorage object
I'm trying to persist data using redux-persist. Here is my code:
import { createStore as _createStore, applyMiddleware, compose } from 'redux';
import createMiddleware from './middleware/clientMiddleware';
import { routerMiddleware } from…

Muhammad Ateeq Azam
- 1,009
- 1
- 12
- 26
2
votes
2 answers
Reac-Router v4, server side rendering, ReferenceError: document is not defined
I'm using react-router version 4 and trying to handle routes on the server.
All tutorials including offical Server Rendering guide on ReactTraining repo and React Router tutorial - server side rendering are using React Router v3.
The only available…

Fakhruddin Abdi
- 876
- 2
- 11
- 25
2
votes
4 answers
Add Server Side Rendering to create-react-app
i am studying create-react-app and SSR.
I have add redux and react-router in this repo => https://github.com/sarovin/StarteKit.
Now i want add SSR ( server side rendering ) without any modification to create-react-app.
I have a PR where i try to…

SaroVin
- 1,583
- 3
- 23
- 46
2
votes
1 answer
react-router v2 - replace in onEnter doesn't work
In my app I'm using react-router v2 - https://github.com/reactjs/react-router
I have problem with redirect in onEnter:
some component
static async onEnter({ flux }, nextState, replace, callback) {
const token =…

Kosmetika
- 20,774
- 37
- 108
- 172
2
votes
0 answers
react-router RouterContext deployment error
I'm struggling to make my universal React web app run on the server (OpenShift). I developed other universal apps before, but never encountered this error:
Basically, when running on the server the RouterContext passed to ReactDOM.renderToString()…

Massimo
- 112
- 2
- 9
1
vote
2 answers
Cannot access subpages of my NextJS static site on S3 via cloudfront when public access is blocked
I have configured cloudfront to serve my NextJS static site from an S3 buckets. I have intentionally blocked all public access to my S3 bucket, so the only way to access this site would via the cloudfront URL (I've set up Origin access control "OAC"…

netsrikc
- 11
- 4
1
vote
0 answers
add index.css and image to index.html with server-rendering-react-components
I am learning server rendering react currently. And I try to convert a product-landing -page Demo to react with express, babel, Webpack.
There are two problems currently after building and running npm start:
index.css cannot link to index.html, the…

Joanna
- 81
- 1
- 6
1
vote
0 answers
Next.js: backend server path is defined in next.config.js rewrites() but it returns 404 error
This is the path I want to visit to:
export async function getServerSideProps() {
const url = 'http://127.0.0.1:3000/api/auth/profile/';
const resp = await axios.get(url, {withCredentials: true})
const json = await resp.json()
…

forest
- 1,312
- 3
- 20
- 47
1
vote
0 answers
React - Redux - Server Side rendering not rendering when the api url is dynamic
I am using react Server side rendering, when my api url is static, i get a response and my server side rendering works but when there is a valid(dynamic) parameter in my api url, i get a api response but the page will not inject the response to the…

user1675340
- 21
- 3
1
vote
1 answer
StaticRouter not working with dynamic routes in Server render
I have a dynamic parameter in a route. When I directly open the URL it throws an error.
To make my server aware of the route I m using static router in server rendering.
Here's my server render code:
const serverRender = (req, res) => {
const…

Waeez
- 289
- 4
- 12
- 29
1
vote
0 answers
Meteor app deployed to galaxy with react server-render not attaching eventHandlers to dom
I have a meteor app that follows this file structure, https://guide.meteor.com/structure.html#example-app-structure and uses React's server-render. While testing locally, meteor --port 3000, the client has eventHandlers attached via…

Junhao
- 179
- 3
- 13