Category "next.js"

"Websocket connection failed" when proxying requests to Next.js app via Apache server

Since upgrading to Next.js 12 I'm getting the following error in the console when I run my Next.js app: WebSocket connection to 'wss://mysite.local/_next/webpa

Using Remark and Rehype plugins with MDX in Next.js (with @next/mdx)

I was trying to use Github Flavored Markdown using @next/mdx but I can't seem to figure out how to use plugins with the code. Here is what I did: (I am followi

NextJS scroll into view of specific component upon button OnClick that exists on a different js file

I'm using NextJS and I have my components on different js files that come together under one js file on my "pages" folder (index.js). What I want to be able to

Adding inline stylesheets in HEAD on Next.js blog

I have a blog (http://minid.net) in Jekyll that I want to migrate to Next.js. My blog doesn't use an external file for styles. I embedded all the styles in the

Is it possible to generate static pages in nextjs when using redux-saga?

Warning: You have opted-out of Automatic Static Optimization due to getInitialProps in pages/_app. This does not opt-out pages with getStaticProps I tried dif

Dockerize NextJS Application with Prisma

I have created a NextJS application, to connect to the database I use Prisma. When I start the application on my computer everything works. Unfortunately, I get

next js dynamic route redirect to home page on refresh

I have a dynamic route in my project and its not ssr. When I refresh the page, it redirects to the home page, but in the other pages the refresh works as inten

Revalidate key in Next.js

As you know, we can update SSG page via revalidate key in getStaticProps() and user at firstly see latest content and after refresh page twice can see updated c

Next-Auth getSession is returning null in my development environment

I'm using the following code in one of my pages: export async function getServerSideProps(context) { const session = await getSession(context) return {

Next.js - router.push without scrolling to the top

I am using router from next by importing useRouter from next/router. I am trying to find a solution which will not scroll to the top of the page when I change t

ID is gone when I refresh a NextJS Dynamic Route page

I am trying to get dynamic routing working in order to display and retrieve the right information using the id from the url. This works when I visit the page, b

Next.js: How to get static assets from within getStaticProps

I am using Netlify CMS. I want to import all the slides for a carousel into my component. I made a collection called slider and added a few slides. That created

Getting error: The expression is not callable Mongoose NextJS

I trying to save data to a mongoose model on NextJS page. I get a typescript error on this line: await User.create(data) This expression is not callable. Each

TypeError: Cannot convert undefined or null to object next.js

Error - TypeError: Cannot convert undefined or null to object This error happened while generating the page. Any console logs will be displayed in the terminal

create-next-app' is not recognized as an internal or external command, operable program or batch file

I'm trying to install next app with npx create-next-app nextjs-blog and i keep getting this error; 'create-next-app' is not recognized as an internal or extern

How to style child elements with vanilla extract?

I am starting to use vanilla extract to style a NextJS app. Is there any way to style child elements from the parent without creating another class? I have an s

Prisma Schema not updating properly after adding new fields

As the title states, I am using Prisma 2 in a Next JS app. I have a very simple schema: model User { id Int @id @default(autoincrement())

Getting this error while making a post request ( API resolved without sending a response for /api/comments, this may result in stalled requests.)

Hi i have started learning Next.js and currently unable to make a POST request on api. I have a comments folder inside the api folder. And inside the comments i

How to open a link in a new Tab in NextJS?

How can i open a link in a new Tab in NextJS ? i tried this : <Link href="https://twitter.com/" passHref> <a target="_blank">

I am getting an error on login with Auth0 and NextJs

I have tried a serverless auth0 with NextJs/React example that is identical on 2 different sites. I am getting an error when I click login and I can't understan