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
1
vote
1 answer

How to get the url on Next.js 13 Server Side Rendering

I tried to get it with window.location.href, it says window is undefined, i searched the internet for handling this and getting the url from server side but no results on next js 13, Do you have an idea?
CatalinPCE
  • 21
  • 5
1
vote
0 answers

how change build default type to ssr in next js versrion above 13

When I build project and then navigate in app with router.push , next js loads deeply page After research, I found that if I build the app as runtime or ssr, the situation will be resolved. Now the issue is that every time I build the project,…
behnam
  • 106
  • 1
  • 6
1
vote
0 answers

Not able to use DOMPurify.sanitize in angular application, when imported as an ES6 module

I'm trying to use dompurify in my angular application, where in a service. I'm importing it as import * as DOMPurify from 'dompurify'; This works fine when run normally as a CSR application. But if I run it as a SSR, I get export 'sanitize'…
1
vote
1 answer

SSR Function Works in Mozilla but Not in Chrome

I'm facing an issue with my Next.js project involving server-side rendering (SSR). In my application, I have a payment flow where the user is redirected to a bank page for payment. Upon returning to my page, I rely on an SSR function to retrieve and…
1
vote
1 answer

server side rendering script tag in php

I want to run a widget that is in the form of script tag on my personal server, which is Ubuntu, and show it on another site. How to do this with PHP? *Consider that I want to receive script information on my server (server side render) and only…
Brad1
  • 11
  • 1
1
vote
1 answer

Not able to Extract query string on the ServerSide in NextJS

I'm using NextJS app directory structure for routing. /app/page.jsx import ListProduct from "@components/products/ListProduct"; import axios from "axios"; const getProducts = async (min, max, category, rating) => { …
1
vote
1 answer

How to navigate routes in a functional server component in nextjs app router V13+

In pages I was able to navigate routes on the server by setting up a return statement in getServersideProps() Before: export const getServerSideProps = async (context) => { try { .......... // If token exists; redirect to '/' …
Ibra
  • 912
  • 1
  • 12
  • 31
1
vote
0 answers

Alternative to useState in a Next.js server component?

Given that I have a static site (https://abdullahraheel.tech/) with the sole interactive feature being the ability to toggle dark mode, I acknowledge that using useState is not possible in a server component. export default function RootLayout({…
1
vote
2 answers

If i use Redux in NextJS 13, will it be still server-side project?

I want to use Redux in NextJS 13 project (app folder structure) . But for use it i need use provider, and provider will be in layout.jsx. But for use provider, i need use "use client"; annotation for make it client-side component. And my all pages…
1
vote
0 answers

ReactJS- server side rendering without prefetching API response in server.js

In a React app, I need to call APIs server-side without server.js being aware of which APIs to call. The API calls should be encapsulated within the app's source code, and when server-side rendering is enabled, the APIs should be called internally…
Shal
  • 41
  • 2
1
vote
1 answer

Issue with deploying Angular Universal app with Angular Fire on Firebase

I'm currently facing an issue while deploying my Angular Universal app with Angular Fire on Firebase. I have followed the official Angular Universal documentation and the new Firebase web frameworks guide, but I'm not getting the expected result…
1
vote
1 answer

Same page content shows on every url

I want to use a multi-step form with Next JS but to do so I must add the inside the app.js file which looks like this: import React from "react"; import ReactDOM from "react-dom"; import App from "next/app"; import Head from "next/head"; import…
altini
  • 11
  • 2
1
vote
1 answer

Hydration error in Next.js when I refresh after changing language(except english) using next-translate/useTranslation

I'm having trouble with the useTranslation hook from the next-translate package in my Next.js application. While all my languages are being recognized, I encounter a hydration error whenever I change the language and refresh the page. Here's the…
1
vote
1 answer

Vite SSR getting error "Cannot use import statement outside a module" when rendered server-side

I'm trying to get a simple React application rendering on the server using vite-plugin-ssr, with a 3rd-party package. The 3rd-party package is react-live-runner, which creates an editable code field that the user can edit to see their changes in…
antun
  • 2,038
  • 2
  • 22
  • 34
1
vote
2 answers

use the same ES6 import both node and web pages for parallelize libs

Hi devs! Currently i am trying to create a template engine with only react and htm. It's think out the box, so, no CRA, no Nextjs, no other framework or library. So, It's an hard way. I need to undestand why i can't load the same librs from…
1 2 3
99
100