Category "next.js"

Should all fetching be done inside getStaticProps in NextJS?

In NextJS in order to utilize static site generation, I need to perform all network requests inside getStaticProps. I've removed all the fetch calls in my React

EBADPLATFORM error when installing any npm package into a fresh Nextjs app

Working with a team on a new project -- we have a fresh Nextjs app stood up in our remote repo which another team member has cloned and is working on locally. S

Open messenger with product info

I have searched for this feature, but I'm not sure if it is possible and maybe someone has done this before. I would like to integrate chat messenger (facebook)

Storybook error when using Webpack5 with Next.JS app + Typescript

I am trying to set up a fresh next.js app using Typescript and Storybook. Following some guides online gets me fairly close but I note that the rendered 'HomePa

Why is my favicon not working in my next js app?

For some reason my favicon is not working. I have the favicon saved as favicon.ico in the /public directory and am referencing it in the <Head> of my pag

Message 'Caching failed for pack: Error: Unable to snapshot resolve dependencies' when creating a nextjs application

I tried to create a nextjs application; when i run npm run dev, i got the following error message: <w> [webpack.cache.PackFileCacheStrategy] Caching faile

How can I set a flash variable in Next.js before a redirect?

Laravel in PHP made this easy with https://laravel.com/docs/9.x/session#flash-data, so I figured Next.js would have an easy way too. I thought I'd be able to do

Vercel: Task timed out after 10.01 seconds

I recently deployed a Next.js application for a software engineering boot camp. I am using Vercel for hosting the web app. The problem I am having has been spok

NextJS - Appending a query param to a dynamic route

In my NextJS app, I have a language selector that's visible on every page. When I select a new language, I just want to replace the current URL by appending a q

Digital Ocean App build error with NextJS imports/exports

I have a problem with building app process in Digital Ocean, I have an app already deployed and I have implemented a big refactor in the code structure, in my l

NextJS: Main and Nextscript

Exploring NextJS a bit for its server side rendering features. It looks really nice and easy to use. I already explored the _document.js file which we can inclu

useRouter/withRouter receive undefined on query in first render

I got a problem with my dynamic route. It look like this [lang]/abc I am trying to get query value from [lang] but when I using useRouter/withRouter i got qu

Storybook throws an error when I want to install it with Next

Storybook throws this error when I am trying to install with a Next.js app which already exists: • Detecting project type. ✓ • Adding Storyb

API resolved without sending a response in Nextjs

I have to make same changes in my nextjs project because my enpoint API doesn't support many calls and I would like to make a refresh from the original data eve

Can i use my own sign in form for aws cognito?

I have a nextjs app that use aws cognito for auth. i was wondering if there is a way to replace the hosted ui provided by aws with my own custom form. import {

Next.js overlaps static route with dynamic route

I am using Next.JS application routing system. I have created a dynamic route with structure like pages/[country]/[language]/index.js. Also there is a static ro

Next.js and Webpack inline Javascript or CSS ressources

I have the following use case: I need to generate static files with React and Next.js. For that I extended the next.config.js with the following content: module

[next-auth][error][client_fetch_error] NextAuthJS CredentialsProvider "providers SyntaxError: Unexpected token < in JSON at position 0"

As a beginner in Next.js I came across NextAuthJS. I wanted to use custom email and password authentication and thus I went with Credentials Provider and config

The default export is not a React Component in page: "/" NextJS

Not sure why the error is coming up, heres my index.js and App.js (the default export). I have used export default in the app.js. index.js: import "./index.cs

Is Next.js app an SPA or single page application?

Plain React apps are called SPA because they have only one html page which is the index.html. But that is not the case for next.js. So can we call a next.js app