Skip to content
Advertisement

Tag: next.js

Axios is returning empty string value

The problem I’m facing here was, whenever I fetch the data with a button click (the button that leads to this route), the data will be fetch successfully, but whenever I input the link address directly myself in the browser, It keeps returning empty string when i console.log the data (Like this <empty string>), and keep throwing error saying “allCars.map

Next.js Components: Error: error: Return statement is not allowed here

I am running into an error when I add a new component into my Next.js Project where it gives the following: `./components/GridMember.js Error: error: Return statement is not allowed here | 6 | return (test); | ^^^^^^^^^^^^^^^^^^^^^^^^^ Caused by: 0: failed to process js file 1: error was recoverable, but proceeding would result in wrong codegen 2: Syntax Error` [error][1]

Nextjs UseEffect is not rendering on route change

I am having problem with a useEffect inside a component which is in every component. I have made some authentication and redirects in that component but I figured that when I use Nextjs link or the go back button from the browser, the Layout useEffect is not re rendering which means it is not checking if the user is logged

next js className haven’t been set

I’ve just started playing with next js. so I want to use css as module and setup classname for nav, but in rendered DOM this classname doesn’t exist. I can see generated styles by webpack in “head” tag, but I dont see classname on my nav tag. Answer In JS, we cannot use – as a variable name it is

Server Error ReferenceError: window is not defined in Next.js

I’m trying to integrate CleverTap into my Next.js app. Followed the documentation Web SDK Quick Start Guide but facing issue: Server Error ReferenceError: window is not defined in Next.js _app.tsx cleverTapHelper.ts cleverTap.d.ts Window object should not be undefined but getting undefined! What’s going on? Answer This is because NextJS is trying to execute that function on the server because it

Advertisement