Questions tagged [server-side-rendering]

Serverside rendering is a technique for rendering a client-side app on the server.

Rendering a client application on the server results in a faster experience for end users since they do not have to wait for assets to load before they can see and interact with an app. This is accomplished by using isomorphic code: code which is used on both the server and the client.

4406 questions
8
votes
0 answers

Server Side Rendering, Lazy Loading Responsive Images, correct approach

I'm writing a React based app that uses SSR to generate content suitable for search engines and the initial client load, and using React.hydrate() on the client. All good. On pages with tags, I'm using both src, srcSet and sizes attributes on img…
Dave Meehan
  • 3,133
  • 1
  • 17
  • 24
8
votes
2 answers

Angular 7 Cookie for SSR (universal)

I'm trying to implement SSR for my angular app. I followed the universal starter guide (https://angular.io/guide/universal). My angular app consumes a rest API which need an access_token (client_credentials grant_type) for all requests. Im using…
lovis91
  • 1,988
  • 2
  • 14
  • 24
8
votes
2 answers

React SSR: Document is not defined

I have been working on this for two days now. Looked through multiple stack posts and still not found a suitable answer. I am trying to rendering my react project in server like following: Server.js function handleRender(req,res){ const…
ZpfSysn
  • 807
  • 2
  • 12
  • 30
8
votes
2 answers

Title and Meta tags not rendering in angular SSR in server

I have developed a website using Angular 6 in the frontend. By default Angular is not SEO friendly, so in order to do that, I implemented it in the way of Angular-Universal or Angular SSR (Server Side Rendering). I updated the code and comparing the…
8
votes
2 answers

NextJS Track Mounted Components in SSR

The following applies to SSR via NextJS. I'm using React's context to keep track of IDs of certain mounted components. The gist is class Root extends React.Component { getChildContext () { return { registerComponent:…
Tyler Sebastian
  • 9,067
  • 6
  • 39
  • 62
8
votes
1 answer

React Server Side Rendering with Sass

As i have searched through the previous but could not find any relevant / solved issues on this so I ask... Current stack: React, express/node, Sass, Webpack, Sass. I have a question specific to the Styling of pages before server sends them to the…
Ash
  • 585
  • 7
  • 15
8
votes
1 answer

ReactDOM RSS renderToString production error

I created new boilerplate for react16. https://github.com/jasonvillalon/react16-boilerplate its working when running in development using: npm start npm start:webpack but when running in production it throws error on…
8
votes
3 answers

NUXT - SSR - components are not being rendered server side

I'm new to Nuxt - converted my vue app to it, and got it working on production: gameslate.io The app is using the asyncData method to get the list of games - however the full layout isn't being rendered the server... If you view the page source…
geoctrl
  • 685
  • 7
  • 22
8
votes
2 answers

Server Side Hydration with Vue.js and SSR

I have a Vue.js App working with Server Side Rendering (SSR) and then client side hydration and it works great. I love building isomorphic javascript and think it is the way of the future. But there is still one issue i would like to solve. Here is…
smitt04
  • 3,018
  • 2
  • 28
  • 30
8
votes
3 answers

asp.net core, angular 2, PrimeNG

I use aspnetcore-spa template as starting point to create admin panel. Next I add PrimeNG library to use it's components. Unfortunately, when I import i.e. ButtonModule to app.module.ts and refresh, I get an error 'Event is undefined'. I can't…
8
votes
3 answers

How to structure multiple HTTP requests in a server-side rendered React app?

I am currently using the below server side rendering logic (using reactjs + nodejs +redux) to fetch the data synchronously the first time and set it as initial state in store. fetchInitialData.js export function fetchInitialData(q,callback){ …
Learner
  • 2,303
  • 9
  • 46
  • 81
8
votes
3 answers

what is server side rendering using angular2?

I am aware that angular2 is used for server side rendering. So I would like to know more about it. I am having following questions regarding this phenomenon. 1.What is server side rendering? 2.what problem does it solve? 3.what are its…
Bhushan Gadekar
  • 13,485
  • 21
  • 82
  • 131
7
votes
0 answers

Dynamically import a module Next.js, but with server side rendering

I have a [...pageId].tsx file in the /pages directory. In getServerSideProps, the page will check a CMS, and find a list of components to render. I want to load those components serverside, then render them out, then return the page. Using…
7
votes
1 answer

How to get cookies in Next Js 13 (beta) in Server Side Rendering

I am trying to fetch User from my own API which needs a token (i can store the token in localStorage or in Cookies). As there is no localStorage access when using server side rendering, i have to use cookies. But the cookie is undefined in the…
7
votes
3 answers

How should we use React's Context API in Next.js 13?

We were using react's context API in our next.js 12 apps. We want to upgrade to next.js 13. We get this error: react__WEBPACK_IMPORTED_MODULE_0__.createContext is not a function For this code: import React from 'react' const SiteContext =…
Big boy
  • 1,113
  • 2
  • 8
  • 23