Security of secrets added to next.config.js

We are working adding Auth0 to our Next.js website and referencing this example. What I am wondering about is the settings in next.config.js in the example. It puts the Auth0 and other secrets in...

Flash Of Unstyled Text (FOUT) on reload using next.js and styled components

I'm using global style from styled components with next.js and every time I reload my page I can see the font flickering. I have my font files in public/fonts/Inconsolata I've looked everywhere...

Uncaught Error: Based on the provided shape, [1024,3], the tensor should have 3072 values but has 30

I am trying to build a Tensorflow.js app, it works all good locally, but when I hosted it (I tried Netlify and Vercel on both Firefox and Chrome) I got this error: Uncaught Error: Based on the...

How to disable directory listing in Next js deployed to Vercel

I have deployed website built in Next.js and apparently when you deploy a next js app you can find the directory of all the static files and resources which i don't feel very good about. the...

Mutate data across pages with SWR in NextJS

I am using SWR in a NextJS project. I am fetching a list of data in my index page. In my create page I add a new entry to the data. Now I want to make use of SWR mutate to mutate the cached data...

Issues deploying Next.js to Vercel using #getStaticProps()

Using Next.js hooked up to Apollo, I have a good 50 or so non-dynamic urls fetching data using getStaticProps(). It works wonderfully, and I love how the pages load in. The issue I am facing is...

Server configuration for Vue.js History Mode with Vercel?

I set up a very basic Vue.js app essentially using these steps. When I added the router to this project, it asked whether I wanted to use History Mode and I said yes. Now I am trying to implement...

Deploying React app to production returns "You need to enable JavaScript to run this app"

Problem I have an axios call at "/artists", that gets a list of artists returned as an array of JSON. It works in development. However, in production it outputs an HTML element that says You need...

How do I add Google Application Credentials/Secret to Vercel Deployment?

I am using Vercel Deployments with a NextJS app. Deployments are automatically run when I push to master, but I don't want to store keys in GitHub. My serverless functions are reliant on my...

How do I add Basic Authentication to Nextjs node server?

I don't want to add authentication to some external request or OAuth. Just a server-side Basic Auth to the node server. As of writing Next.js doesn't seem to support it:...

Next JS build failing due to ''Export encountered errors on following paths"

I am encountering this build error when I deploy my next js site to vercel 15:02:38 > Build error occurred 15:02:38 Error: Export encountered errors on following...

Link component interpolation error nextjs

I am getting this error in Next.js: Error: The provided 'href' (/subject/[subject]) value is missing query values (subject) to be interpolated properly. Read more:...

No "exportPathMap" found in "next.config.js". Generating map from "./pages"

I got this error when deploying Next.js to Netlify. Error: Image Optimization using Next.js default loader is not compatible with `next export`. Possible solutions: 6:47:15 AM: - Use `next...

NextJS deployed to Vercel: 404 page not found

I have a NextJS app without an integrated api that I want to deploy to Vercel. It works fine when I run it locally yarn run dev and I can also build it yarn run build without any errors. When I...

Unable to fetch excel file in production in nextjs

I have an excel file named Words.xlsx in public directory. Initially, during development mode, setting file path to /public/Words.xlsx worked fine but it failed in production mode saying that it...

Deploying to Vercel - Can we deploy React Apps served in Node Servers?

My Situation I'm able to deploy APIs to production in Vercel with a vercel.json: { "builds": [{ "src": "backend-build/index.js", "use": "@now/node-server" }], "routes": [ { "src":...

Startup script for a Next.js app using Phusion Passenger (starting the production build using a file)?

Usually a Next.js app is started using npm run start after building it with npm run build. I can't start it with a command because my web server stack (Phusion Passenger) requires a startup...

NextJS getStaticProps is making mulitple requests to the same endpoint with fallback: true

I've noticed my next application is making a ton of requests to my backend on page load. I'm using getStaticPaths and getStaticProps for when a path wasn't built at build-time so the fallback is...

How to properly type the _document.tsx file from Next.js?

I got most of this code from the official docs example on how to work with styled-components: https://github.com/vercel/next.js/blob/canary/examples/with-styled-components/pages/_document.js But...

how to cleanly handle errors in nextjs getStaticProps

I'm very busy at the moment with building my first Next.JS application (Next and Strapi). Now everything is working but i'm curious about what the best way is to implement error handling when...

Cannot find module '@next/env' Next-js Vercel

I have developed a Next.js app that works fine on my local machine. I am trying to deploy my app on Vercel but it keeps throwing me the error Cannot find module '@next/env' as shown here. I think...

useInfiniteSWR with axios and typescript

We have a very good example on how to use useSWR hooks for axios and typescript on the official repo here...

Website not rendering properly on next.js for mobile

I downloaded a website template online and I didn't like the implementation to converted to TS and a next project so that it could easily be deployed to Vercel. However, when I put it in mobile...

Next Auth getSession API call fails randomly on production

I have set my NEXTAUTH_URL in Vercel. My NextJS app works fine most of the time, but randomly when I navigate to a new page, I'll get a 500 server error when the next-auth useSession() hook is...

Cypress test runs before Vercel deployment in Github Actions

Long-time lurker, first time caller. I have successfully created a script to test Vercel test deployments using Cypress integrated with Github Actions. Although the test works and the desired...

Vercel - `ZLIB_1.2.9' not found

I am trying to use canvas in a server less function on Vercel, but am running into an error I don't know how to get around: Error: /lib64/libz.so.1: versionZLIB_1.2.9' not found (required by...

Vercel deployment error: Module Not Found remotelly works locally. Cached build is the problem?

I'm making this site using Next.JS hosted @ Vercel. One of the packages I'm using is a custom one that I've forked, updated it in my project and after the build, was able to make it work locally....

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-loading-swc I've tried uninstalling node...

SvelteKit could not resolve dependency even though it's external

I'm making a user authentication page and in that matter, I'm using bcrypt for hashing. Everything was nice and well until I actually use the bcrypt module in the code. Running it in development...

How to deploy monorepo powered by turborepo to Vercel?

Recently, Turborepo is acquired by Vercel. So I was excited to experiment with that. I created a turbo repo project by running pnpx create-turbo Then I tried to deploy it to Vercel following the...