Next.js Discord

Discord Forum

NextJs tutorial Chapter 6 Build Errors.

Unanswered
Grass carp posted this in #help-forum
Open in Discord
Grass carpOP
 nextjs-dashboard git:(main) ✗ pnpm run build

> @ build /Users/noximus/Projects/Active Projects/next/nextjs-dashboard
> next build

  ▲ Next.js 15.0.0-rc.0
  - Environments: .env

   Creating an optimized production build ...
 ✓ Compiled successfully
 ✓ Linting and checking validity of types
   Collecting page data  ...tl [VercelPostgresError]: VercelPostgresError - 'missing_connection_string': You did not supply a 'connectionString' and no 'POSTGRES_URL' env var was found.
    at tf (/Users/noximus/Projects/Active Projects/next/nextjs-dashboard/.next/server/app/seed/route.js:60:5026)
    ........../////
  code: 'missing_connection_string'
}

> Build error occurred
Error: Failed to collect page data for /seed
    at /Users/noximus/Projects/Active Projects/next/nextjs-dashboard/node_modules/.pnpm/next@15.0.0-rc.0_react-dom@19.0.0-rc-f994737d14-20240522_react@19.0.0-rc-f994737d14-20240522/node_modules/next/dist/build/utils.js:1274:15
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'Error'
}
   Collecting page data  . ELIFECYCLE  Command failed with exit code 1.


I'm a front end person. I would love to get past this so I can concentrate on building the UI.

21 Replies

Grass carpOP
I had to fix this Issue Myself. The NEXTJS tutorials are out of order and are confusing for someone who is not that great with env variables.

The tutorial says to deploy your application. VErcel gives connection string error... so does local build.

The fix... is that you have to connect vercel on your local first! not just upload it. and then you have to
vercel env pull .env.development.local

also need to run a
vercel link
you also need to take the variables out of the
.env.development.local
and put it into the
.env

after figuring all this out on my OWN. it is now working. Someone needs to update the tutorial because it is OUT OF ORDER and confusing.
env variables are missing
@Grass carp
Grass carpOP
you have to use the vercel CLI with your terminal
Grass carpOP
yeah... before you get to the postgres sql part. you have to have a working deploy. but the deploy doesn't work. so you have to figure it out on your own. and there is no troubleshooting help for it. I never got to the postgres sql part.
@Grass carp you have to use the vercel CLI with your terminal
Silver carp
Okay, we have progress! I've successfully ran the prod build locally but I still can't deploy it on vercel. I guess this is because there's no env file on in the repo (env in gitignore) and it actually has to be there for vercel to deploy it?
Grass carpOP
yeah.. you have to skip ahead on the tutorial. and kinda figure it out on your own.
@Zepeto Do you have a git with the code you tried to deploy so I can have a look ?
Grass carpOP
dude... your like a week late.
@Grass carp dude... your like a week late.
That's why I'm asking if you have a git with commits to be able to go back ...
Grass carpOP
I do. but commits won't help. because the problem is not in the code.
the problem is setting up the Vercel CLI a
I understand, but I'd like to reproduce your issue by trying to deploy with your code
Grass carpOP
you won't be able to reproduce my error. I guarantee it.
I'll send you the git though
you'll see in my commit history where I was trying to fix it.
Grass carpOP
i found he issue to be with setting up my vercel client and properly connecting it. I only realized i need to do this because I have used vercel in the past. it's been about 8 months since I've pushed to vercel so I fogot there was a vercel cli at all.