Category "next.js"

When refreshing a page developed by nextjs error occurred

I have developed a project by nexjs which their backed is IIS and all these are working properly. I have an URL address like this : dastshafa.ir/product/2/

<Link> does not work as expected in NextJS

I am working on creating a Next.js app and part of it requires me to create a dynamic route on click of a card component. However, after wrapping my Cards with

Why I am getting this error: declares '<MODULE>' locally, but it is not exported

I have a typescript file which exports a function to send emails using aws ses //ses.tsx let sendEmail = (args: sendmailParamsType) => { let params = {

How to make path for pages in NextJS case insensitive

I have a file under the pages folder named about.tsx. So the path for the page is /about and I'm able to access the page by visiting example.com/about. However,

Markdown is not being displayed correctly due to CSSReset - Chakra-ui

I'm making a NextJs Blog, and I have to render my markdown in a dynamic page. CSSReset is being used in my app, and as a consequence, markdown is not being disp

NextJs - External synchronous scripts are forbidden

I am using nextJs version 11.x When trying to include an external script like below, getting an error when executing the yarn build. <Head> <link rel="

VSCode does not auto-import from "react" in Next.js projects

* This is not a duplicate of this question; the accepted answer there is made for TypeScript and doesn't seem to work for JavaScript. I am working on a Next.js

Cannot deploy Next.js to Netlify. Deploy failed due to an error in @netlify/plugin-nextjs plugin

I can run npm run build with no problems at all, but whenever I try and deploy my Next.js project to Netlify I get an odd error stating Deploy failed due to an

Next failed to load SWC binary

When trying to run the command using nextjs npm run dev shows error - failed to load SWC binary see more info here: https://nextjs.org/docs/messages/failed-load

How to get localStorage, createContext, withrouter and history, component from react to work on client side while using NextJs?

I am trying to get the localStorage to work but I do not know how to load the code on just the client side. Also to just have certain files run with the informa

Vercel 500 internal error! Cannot get logged in

[GET] /auth/signin?callbackUrl=http://localhost:3000 17:22:23:77 2021-10-24T12:22:24.062Z a07d6ace-3b47-4472-a45b-f7ef9989a9b5 ERROR [next-auth][err

Next.js: How to make links work with exported sites when hosted on AWS Cloudfront?

I'm trying to get a prototype Next.js project up by doing a Static html export (i.e. next export) and then copying the generated output to AWS S3 and serving it

Typescript says NextJS environment variables are undefined

I'm trying to make social login using 'react-google-login'. .env in root NEXT_PUBLIC_GOOGLE_CLIENT_ID=askfjaskf Ready.tsx import { GoogleLogin } from "react-go

How to route to page using Dynamic Routes in next.js

I am trying to route these urls to [id].js file in next.js, So everything is working for url 2 and 3 below, but its not working for url 1 so I have to create an

React + NextJS - Protected routes

Objective : I want to redirect a logged in user to the home page if he/she tries to manually go to the /auth/signin. Signin page/component : const Signin = ({

Importing react into pages in next.js (and also React and CRA apps)

I have a Next.js app with several pages in it. All of the pages look similar. import React, { Component } from "react"; import from "components/Wrapper"; expo

Get client IP in getServerSideProps method in NextJs [duplicate]

I am trying to find the IP of the client in getServerSideProps in NextJs. I simply use basic IP found methods but when I call that method in g

NEXT/Image Component URL issue

I am using NEXT/Image component and facing this issue: When I open the source code on chrome the image src is this: https://www.example.com/_next/image?url=%2Fi

NextAuth authentication not working on Deployment on Vercel (Working on localhost)

Used credentials for authentication with nextauth. My code is not working on vercel deployment but working on localhost. I used the basic cresdentials for authe

How to upload a single image file with next.js to mongodb?

When I'm uploading form data to mongodb, in the image section it shows this: "C:\fakepath\imageName.jpg" with no actual image in it. And when I fetch the data f