Next.js Discord

Discord Forum

Nextauth_URL and Vercel CI with github actions

Unanswered
Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
Here is my YAML
name: Deploy Development Web App
permissions:
  contents: read
  packages: write
env:
  VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
  VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
  VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
defaults:
  run:
    working-directory: ./webapp/
on:
  push:
    branches:
      - dev
jobs:
  Deploy-Preview:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: "dev"
      - name: Install Vercel CLI
        run: npm install --global vercel@canary
      - name: Install Prisma CLI
        run: npm install --global prisma@latest
      - name: Pull Vercel Environment Information
        run: vercel pull --yes --environment=development --token=${{ secrets.VERCEL_TOKEN }}
      - name: Move env
        run: cp ./.vercel/.env.development.local ./.env
      - name: Build Project Artifacts and Deploy to vercel
        run: vercel build --yes --token=${{ secrets.VERCEL_TOKEN }}
      - name: Deploy any schema changes to Planetscale
        run: prisma db push --skip-generate client_go
      - name: Deploy Project Artifacts to Vercel
        run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}


I add all my environment variables on Vercel but when vercel builds it is missingthe NEXTAUTH_URL. even though it should not be required...... Furthermore, if I manually add my development URL to vercel as an environment variable, everything compiles very good BUT I get a client fetch error 🙃

Any help would be appreciated thanks!

2 Replies

Giant panda
Same issue I'm having.
Northeast Congo LionOP
I don't know how I fixed it but it works 😂