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
0 answers

Parsing session in Server Side Component in NextJS

I need some suggestions related to the implementation of the following use case in NextJS. After the user has logged in, I am saving all the details including the token in a session (next-auth session). And now I have a sidebar that I want to render…
1
vote
1 answer

SEO performance with Next.js App Router: Server Component or Client Components?

I used to think that when you declare a page or component with the "use client" directive, you won't be able to see those pages on the "View Page Source" of browsers, since they are rendered only on the client side, using JS (Just like what happens…
Amin Jafarlou
  • 336
  • 1
  • 10
1
vote
1 answer

How does ssr is happening if I have used "use client" in a tsx file?

I have just started working on nextJS 13.4.12 and currently shifting a project from react to nextJS. While working on the login page I found that nextJS does not allow to use react-hook-form or @hookform/resolvers/yup on server-side components. For…
1
vote
2 answers

Astro: browser or server side?

How to detect if astro rendering happens in browser or on the server side? Found no info in official reference and troubleshooting guide. The only 'advice' I found is to use 'client:only'. UPDATE Solution found export const isCLientSide =…
Dmitry Kaigorodov
  • 1,512
  • 18
  • 27
1
vote
0 answers

Angular Universal Package not adding main.server.ts , tsconfig.server.json,server.js, app.server.module.ts files in Angular .NET core fresh project

I was trying to install angular universal in my .NET 6 Angular Project as default in VS2022. However , as seen in the screenshot , the package is installed but missed all the files that needs to be generated like server files , config files . I …
1
vote
1 answer

NEXTJS Server Side Rendering Gives Undefined

I am trying to get data as given solution above but still i am getting undefined instead of data but when I send this same request through postman and thunderclient it gives me success with 200 status code. Please Guys, help me out... export async…
1
vote
0 answers

How to use UI libraries that utilize Providers with NextJS app router, inside server-side components?

Most recent libraries like ChakraUI, Mantine, AndD, ... require you to wrap you entire application inside a Provider component. However, by doing so, all the content created by these libraries should be used inside client-side pages. Now imagine a…
Amin Jafarlou
  • 336
  • 1
  • 10
1
vote
0 answers

Error: You are trying to create a styled element with an undefined component

I am trying to migrate my existing project from CRA (Create React App) to Vite. I am facing an issue: 'Error: You are trying to create a styled element with an undefined component. You may have forgotten to import it.'. My intention for this…
1
vote
1 answer

Error: ENOENT: no such file or directory, open '/var/task/src/content/hello.mdx' - Next.js blog Vercel production deployment error

I am building a blog section for my personal website. I am not able to open a blog post due to the following error: (Vercel logs) Error: ENOENT: no such file or directory, open '/var/task/src/content/hello.mdx' at Object.openSync…
1
vote
1 answer

Redirect to another page server-side in the app directory of Next.js

I have a server-rendered page in a Next.js application and I want to check a condition and redirect to another page. See the code below to understand better: // This is a server-rendered page export default async function Packs() { const…
1
vote
1 answer

Vue SSR not picking up unhead metadata

I have been trying to implement SSR in Vue 3 with very good results. However, I have hit a complete roadblock with how to add SEO Tags. I have been using unhead for this purpose and it seems to load the title and tags fine once the page is loaded.…
user13089814
1
vote
0 answers

TypeError: api.createContextKey is not a function when running Next.js development server

I am encountering an error while trying to run the development server for my Next.js project. Whenever I try to integrate MUI with my project I encounter these types of errors. The error message indicates a TypeError related to api.createContextKey…
1
vote
1 answer

share data between serve side components

Can I make this more efficient without having to do two call to getPosts ? I want to use the initial posts to create different layout but i dont want to keep using getPosts() or is that juts not possible ? import { getPosts } from…
1
vote
1 answer

How to share state between react client components with a parent server component?

In my next.js app I have a page with two components: A and B. // page.tsx import A from './A' import B from './B' const Page = () => { return ( ) } export default Page // A.tsx 'use…
1
vote
0 answers

Error: Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten. on Angular Universal SSR application

I am working on developing an Angular application with SSR (using Angular Universal) and when launching the application on the remote server I get this error: Error: Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been…