Estou tentando fazer o deploy pela plataforma da Netlifly, porém estou tendo problemas na hora de sinalizar o deploy. Poderia me esclarecer melhor como funcionam estas duas variáveis :
DATABASE_URL
DIRECT_URL
5:02:16 PM: Netlify Build
5:02:16 PM: ────────────────────────────────────────────────────────────────
5:02:16 PM:
5:02:16 PM: ❯ Version
5:02:16 PM: @netlify/build 29.41.1
5:02:16 PM:
5:02:16 PM: ❯ Flags
5:02:16 PM: baseRelDir: true
5:02:16 PM: buildId: 662ffc8f7519e90fbf4bfc52
5:02:16 PM: deployId: 662ffc8f7519e90fbf4bfc54
5:02:16 PM:
5:02:16 PM: ❯ Current directory
5:02:16 PM: /opt/build/repo
5:02:16 PM:
5:02:16 PM: ❯ Config file
5:02:16 PM: No config file was defined: using default values.
5:02:16 PM:
5:02:16 PM: ❯ Context
5:02:16 PM: production
5:02:16 PM:
5:02:16 PM: ❯ Installing plugins
5:02:16 PM: - @netlify/[email protected]
5:02:16 PM:
5:02:16 PM: ❯ Using Next.js Runtime - v5.1.2
5:02:18 PM:
5:02:18 PM: @netlify/plugin-nextjs (onPreBuild event)
5:02:18 PM: ────────────────────────────────────────────────────────────────
5:02:18 PM:
5:02:18 PM: No Next.js cache to restore
5:02:18 PM:
5:02:18 PM: (@netlify/plugin-nextjs onPreBuild completed in 14ms)
5:02:18 PM:
5:02:18 PM: Build command from Netlify app
5:02:18 PM: ────────────────────────────────────────────────────────────────
5:02:18 PM:
5:02:18 PM: $ npm run build
5:02:18 PM: > [email protected] build
5:02:18 PM: > npx prisma db push && npx prisma generate && next build
5:02:19 PM: Prisma schema loaded from prisma/schema.prisma
5:02:19 PM: Datasource "db": MySQL database
5:02:19 PM: Error: Prisma schema validation - (get-config wasm)
5:02:19 PM: Error code: P1012
5:02:19 PM: error: Environment variable not found: DIRECT_URL.
5:02:19 PM: --> schema.prisma:8
5:02:19 PM: |
5:02:19 PM: 7 | url = env("DATABASE_URL")
5:02:19 PM: 8 | directUrl = env("DIRECT_URL")
5:02:19 PM: |
5:02:19 PM: Validation Error Count: 1
5:02:19 PM: [Context: getConfig]
5:02:19 PM: Prisma CLI Version : 5.9.1
5:02:19 PM:
5:02:19 PM: @netlify/plugin-nextjs (onEnd event)
5:02:19 PM: ────────────────────────────────────────────────────────────────
5:02:19 PM:
5:02:19 PM:
5:02:19 PM: (@netlify/plugin-nextjs onEnd completed in 5ms)
5:02:19 PM:
5:02:19 PM: "build.command" failed
5:02:19 PM: ────────────────────────────────────────────────────────────────
5:02:19 PM:
5:02:19 PM: Error message
5:02:19 PM: Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
5:02:19 PM:
5:02:19 PM: Error location
5:02:19 PM: In Build command from Netlify app:
5:02:19 PM: npm run build
5:02:19 PM:
5:02:19 PM: Resolved config
5:02:19 PM: build:
5:02:19 PM: command: npm run build
5:02:19 PM: commandOrigin: ui
5:02:19 PM: publish: /opt/build/repo/.next
5:02:19 PM: publishOrigin: ui
5:02:19 PM: plugins:
5:02:19 PM: - inputs: {}
5:02:19 PM: origin: ui
5:02:19 PM: package: '@netlify/plugin-nextjs'
5:02:19 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:02:19 PM: Failing build: Failed to build site
5:02:20 PM: Finished processing build request in 35.276s
5:02:19 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)