redwoodjs / redwood

The App Framework for Startups
https://redwoodjs.com
MIT License
17.15k stars 980 forks source link

Prerender failure stops migrations from running #2684

Closed Tobbe closed 3 years ago

Tobbe commented 3 years ago

When deploying (at least to Netlify) and prerendering fails during build, that stops Prisma migrations from running. But the build as a whole still says everything is alright, so Netlify goes ahead and publishes the deploy. But without prerendering, and code that's not in sync with the DB (since the migrations haven't run), everything is very broken when trying to use the deployed app.

Here's the build log from Netlify

7:54:20 PM: Build ready to start
7:54:22 PM: build-image version: 0582042f4fc261adc7bd8333f34884959c577302
7:54:22 PM: build-image tag: v3.7.6
7:54:22 PM: buildbot version: fc6905501e2254c58ace171d9a44f48b62966f1b
7:54:23 PM: Fetching cached dependencies
7:54:23 PM: Starting to download cache of 313.1MB
7:54:26 PM: Finished downloading cache in 3.437959976s
7:54:26 PM: Starting to extract cache
7:54:38 PM: Finished extracting cache in 11.813362056s
7:54:38 PM: Finished fetching cache in 15.338019512s
7:54:38 PM: Starting to prepare the repo for build
7:54:38 PM: Preparing Git Reference refs/heads/main
7:54:40 PM: Parsing package.json dependencies
7:54:40 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'web/dist' versus '/' in the Netlify UI
7:54:40 PM: Different functions path detected, going to use the one specified in the Netlify configuration file: 'api/dist/functions' versus '' in the Netlify UI
7:54:40 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'yarn rw deploy netlify && yarn rw prisma db seed' versus '' in the Netlify UI
7:54:40 PM: Starting build script
7:54:40 PM: Installing dependencies
7:54:40 PM: Python version set to 2.7
7:54:41 PM: Started restoring cached node version
7:54:44 PM: Finished restoring cached node version
7:54:44 PM: Attempting node version 'lts/*' from .nvmrc
7:54:44 PM: v14.17.0 is already installed.
7:54:45 PM: Now using node v14.17.0 (npm v6.14.13)
7:54:45 PM: Started restoring cached build plugins
7:54:45 PM: Finished restoring cached build plugins
7:54:45 PM: Attempting ruby version 2.7.1, read from environment
7:54:47 PM: Using ruby version 2.7.1
7:54:47 PM: Using PHP version 5.6
7:54:47 PM: Started restoring cached yarn cache
7:54:47 PM: Finished restoring cached yarn cache
7:54:48 PM: Yarn workspaces detected
7:54:48 PM: Started restoring workspace api node modules
7:54:48 PM: Finished restoring workspace api node modules
7:54:48 PM: Started restoring workspace web node modules
7:54:48 PM: Finished restoring workspace web node modules
7:54:48 PM: Started restoring workspace root node modules
7:54:48 PM: Finished restoring workspace root node modules
7:54:48 PM: Installing NPM modules using Yarn version 1.22.4
7:54:49 PM: yarn install v1.22.4
7:54:49 PM: [1/5] Validating package.json...
7:54:49 PM: [2/5] Resolving packages...
7:54:50 PM: [3/5] Fetching packages...
7:55:38 PM: info fsevents@2.3.2: The platform "linux" is incompatible with this module.
7:55:38 PM: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
7:55:38 PM: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
7:55:38 PM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
7:55:38 PM: [4/5] Linking dependencies...
7:55:38 PM: warning "workspace-aggregator-7f49afa0-2b10-4787-8192-981b21ed448e > web > @apollo/client@3.3.15" has unmet peer dependency "graphql@^14.0.0 || ^15.0.0".
7:55:38 PM: warning "@redwoodjs/core > @storybook/addon-a11y > @storybook/api > @reach/router@1.3.4" has incorrect peer dependency "react@15.x || 16.x || 16.4.0-alpha.0911da3".
7:55:38 PM: warning "@redwoodjs/core > @storybook/addon-a11y > @storybook/api > @reach/router@1.3.4" has incorrect peer dependency "react-dom@15.x || 16.x || 16.4.0-alpha.0911da3".
7:55:38 PM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > react-hot-toast > goober@2.0.37" has unmet peer dependency "csstype@^2.6.2".
7:55:38 PM: warning "@redwoodjs/core > @storybook/addon-a11y > @storybook/api > @reach/router > create-react-context@0.3.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
7:55:38 PM: warning "workspace-aggregator-7f49afa0-2b10-4787-8192-981b21ed448e > web > @tailwindcss/typography@0.2.0" has incorrect peer dependency "tailwindcss@^1.5.0".
7:55:38 PM: warning "workspace-aggregator-7f49afa0-2b10-4787-8192-981b21ed448e > web > @tailwindcss/custom-forms@0.2.1" has incorrect peer dependency "tailwindcss@^1.0".
7:55:38 PM: warning "workspace-aggregator-7f49afa0-2b10-4787-8192-981b21ed448e > web > postcss-loader@4.0.2" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
7:56:06 PM: [5/5] Building fresh packages...
7:56:15 PM: success Saved lockfile.
7:56:15 PM: Done in 86.57s.
7:56:15 PM: NPM modules installed using Yarn
7:56:15 PM: Started restoring cached go cache
7:56:16 PM: Finished restoring cached go cache
7:56:16 PM: go version go1.14.4 linux/amd64
7:56:16 PM: go version go1.14.4 linux/amd64
7:56:16 PM: Installing missing commands
7:56:16 PM: Verify run directory
7:56:16 PM: ​
7:56:16 PM: ────────────────────────────────────────────────────────────────
7:56:16 PM:   Netlify Build                                                 
7:56:16 PM: ────────────────────────────────────────────────────────────────
7:56:16 PM: ​
7:56:16 PM: ❯ Version
7:56:16 PM:   @netlify/build 11.29.1
7:56:16 PM: ​
7:56:16 PM: ❯ Flags
7:56:16 PM:   deployId: 60b522ccf682251118978ace
7:56:16 PM: ​
7:56:16 PM: ❯ Current directory
7:56:16 PM:   /opt/build/repo
7:56:16 PM: ​
7:56:16 PM: ❯ Config file
7:56:16 PM:   /opt/build/repo/netlify.toml
7:56:16 PM: ​
7:56:16 PM: ❯ Context
7:56:16 PM:   production
7:56:16 PM: ​
7:56:16 PM: ────────────────────────────────────────────────────────────────
7:56:16 PM:   1. build.command from netlify.toml                            
7:56:16 PM: ────────────────────────────────────────────────────────────────
7:56:16 PM: ​
7:56:16 PM: $ yarn rw deploy netlify && yarn rw prisma db seed
7:56:16 PM: yarn run v1.22.4
7:56:16 PM: $ /opt/build/repo/node_modules/.bin/rw deploy netlify
7:56:19 PM: $ /opt/build/repo/node_modules/.bin/rw build
7:56:21 PM: Generating the Prisma client... [started]
7:56:27 PM: Generating the Prisma client... [completed]
7:56:27 PM: [17:56:27] Cleaning "web"... (./web/dist/) [started]
7:56:28 PM: [17:56:28] Cleaning "web"... (./web/dist/) [completed]
7:56:28 PM: [17:56:28] Building "api"... [started]
7:56:31 PM: [17:56:31] Building "api"... [completed]
7:56:31 PM: [17:56:31] Building "web"... [started]
7:56:56 PM: [17:56:56] Building "web"... [completed]
7:56:56 PM: [17:56:56] Prerendering "web"... [started]
7:57:03 PM: [17:57:03] Prerendering "web"... [failed]
7:57:03 PM: [17:57:03] → Command failed with exit code 1: yarn rw prerender
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/HomePage" in file /opt/build/repo/web/src/Routes.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: error Command failed with exit code 1.
7:57:03 PM: $ /opt/build/repo/node_modules/.bin/rw prerender
7:57:03 PM: [17:56:59] Prerendering /join-team -> web/dist/join-team.html [started]
7:57:03 PM: [17:56:59] Prerendering /onboard -> web/dist/onboard.html [started]
7:57:03 PM: [17:56:59] Prerendering /login -> web/dist/login.html [started]
7:57:03 PM: [17:56:59] Prerendering / -> web/dist/index.html [started]
7:57:03 PM: [17:56:59] Prerendering /invite-player-options -> web/dist/invite-player-options.html [started]
7:57:03 PM: [17:56:59] Prerendering /coach/performance-phase/new -> web/dist/coach/performance-phase/new.html [started]
7:57:03 PM: [17:56:59] Prerendering /coach/performance-phase/scoring -> web/dist/coach/performance-phase/scoring.html [started]
7:57:03 PM: [17:56:59] Prerendering /invite-player-by-qr -> web/dist/invite-player-by-qr.html [started]
7:57:03 PM: [17:56:59] Prerendering /invite-player-by-email -> web/dist/invite-player-by-email.html [started]
7:57:03 PM: [17:56:59] Prerendering /coach-settings -> web/dist/coach-settings.html [started]
7:57:03 PM: [17:56:59] Prerendering /coach-settings/scoring -> web/dist/coach-settings/scoring.html [started]
7:57:03 PM: [17:57:03] Prerendering /join-team -> web/dist/join-team.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /onboard -> web/dist/onboard.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /login -> web/dist/login.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering / -> web/dist/index.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /invite-player-options -> web/dist/invite-player-options.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /coach/performance-phase/new -> web/dist/coach/performance-phase/new.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /coach/performance-phase/scoring -> web/dist/coach/performance-phase/scoring.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /invite-player-by-qr -> web/dist/invite-player-by-qr.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /invite-player-by-email -> web/dist/invite-player-by-email.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /coach-settings -> web/dist/coach-settings.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /coach-settings/scoring -> web/dist/coach-settings/scoring.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: Running diagnostic checks
7:57:03 PM: ✔ Diagnostics checks passed
7:57:03 PM: Not all routes were succesfully prerendered. Run `yarn rw prerender --dry-run` for detailed logs
7:57:03 PM: We could not prerender all your pages, but your Redwood app should still work fine.
7:57:03 PM: This could mean that a library you're using does not support SSR.
7:57:03 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
7:57:03 PM: Command failed with exit code 1: yarn rw prerender
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/HomePage" in file /opt/build/repo/web/src/Routes.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: Could not resolve "/opt/build/repo/web/src/pages/FatalErrorPage" in file /opt/build/repo/web/src/App.js.
7:57:03 PM: error Command failed with exit code 1.
7:57:03 PM: $ /opt/build/repo/node_modules/.bin/rw prerender
7:57:03 PM: [17:56:59] Prerendering /join-team -> web/dist/join-team.html [started]
7:57:03 PM: [17:56:59] Prerendering /onboard -> web/dist/onboard.html [started]
7:57:03 PM: [17:56:59] Prerendering /login -> web/dist/login.html [started]
7:57:03 PM: [17:56:59] Prerendering / -> web/dist/index.html [started]
7:57:03 PM: [17:56:59] Prerendering /invite-player-options -> web/dist/invite-player-options.html [started]
7:57:03 PM: [17:56:59] Prerendering /coach/performance-phase/new -> web/dist/coach/performance-phase/new.html [started]
7:57:03 PM: [17:56:59] Prerendering /coach/performance-phase/scoring -> web/dist/coach/performance-phase/scoring.html [started]
7:57:03 PM: [17:56:59] Prerendering /invite-player-by-qr -> web/dist/invite-player-by-qr.html [started]
7:57:03 PM: [17:56:59] Prerendering /invite-player-by-email -> web/dist/invite-player-by-email.html [started]
7:57:03 PM: [17:56:59] Prerendering /coach-settings -> web/dist/coach-settings.html [started]
7:57:03 PM: [17:56:59] Prerendering /coach-settings/scoring -> web/dist/coach-settings/scoring.html [started]
7:57:03 PM: [17:57:03] Prerendering /join-team -> web/dist/join-team.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /onboard -> web/dist/onboard.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /login -> web/dist/login.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering / -> web/dist/index.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /invite-player-options -> web/dist/invite-player-options.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /coach/performance-phase/new -> web/dist/coach/performance-phase/new.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /coach/performance-phase/scoring -> web/dist/coach/performance-phase/scoring.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /invite-player-by-qr -> web/dist/invite-player-by-qr.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /invite-player-by-email -> web/dist/invite-player-by-email.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /coach-settings -> web/dist/coach-settings.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: [17:57:03] Prerendering /coach-settings/scoring -> web/dist/coach-settings/scoring.html [failed]
7:57:03 PM: [17:57:03] → Unexpected token u in JSON at position 0
7:57:03 PM: 
7:57:03 PM: Running diagnostic checks
7:57:03 PM: ✔ Diagnostics checks passed 
7:57:03 PM: 
7:57:03 PM: Not all routes were succesfully prerendered. Run `yarn rw prerender --dry-run` for detailed logs
7:57:03 PM: We could not prerender all your pages, but your Redwood app should still work fine.
7:57:03 PM: This could mean that a library you're using does not support SSR.
7:57:03 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
7:57:04 PM: error Command failed with exit code 1.
7:57:04 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
7:57:04 PM: Done in 47.17s.
7:57:04 PM: yarn run v1.22.4
7:57:04 PM: $ /opt/build/repo/node_modules/.bin/rw prisma db seed
7:57:07 PM: 
7:57:07 PM: Running Prisma CLI:
7:57:07 PM: yarn prisma db seed --preview-feature --schema "/opt/build/repo/api/prisma/schema.prisma"
7:57:08 PM: Prisma schema loaded from prisma/schema.prisma
7:57:08 PM: Running node "prisma/seed.js" ...
7:57:13 PM: 🌱  Your database has been seeded.
7:57:13 PM: Done in 9.26s.
7:57:13 PM: ​
7:57:13 PM: (build.command completed in 57s)
7:57:13 PM: ​
7:57:13 PM: ────────────────────────────────────────────────────────────────
7:57:13 PM:   2. Functions bundling                                         
7:57:13 PM: ────────────────────────────────────────────────────────────────
7:57:13 PM: ​
7:57:14 PM: Packaging Functions from api/dist/functions directory:
7:57:14 PM:  - graphql.js
7:57:14 PM:  - send-welcome-email.js
7:57:14 PM: ​
7:57:51 PM: ​
7:57:51 PM: (Functions bundling completed in 38.1s)
7:57:51 PM: ​
7:57:51 PM: ────────────────────────────────────────────────────────────────
7:57:51 PM:   3. Deploy site                                                
7:57:51 PM: ────────────────────────────────────────────────────────────────
7:57:51 PM: ​
7:57:51 PM: Starting to deploy site from 'web/dist'
7:57:52 PM: Creating deploy tree 
7:57:52 PM: Creating deploy upload records
7:57:52 PM: 104 new files to upload
7:57:52 PM: 1 new functions to upload
7:58:00 PM: Site deploy was successfully initiated
7:58:00 PM: ​
7:58:00 PM: (Deploy site completed in 8.8s)
7:58:00 PM: Starting post processing
7:58:00 PM: ​
7:58:00 PM: ────────────────────────────────────────────────────────────────
7:58:00 PM:   Netlify Build Complete                                        
7:58:00 PM: ────────────────────────────────────────────────────────────────
7:58:00 PM: ​
7:58:00 PM: (Netlify Build completed in 1m 44.1s)
7:58:00 PM: Post processing - HTML
7:58:00 PM: Processing form - contact
7:58:00 PM: Detected form fields:
7:58:00 PM:  - email
7:58:00 PM:  - club
7:58:01 PM: Post processing - header rules
7:58:01 PM: Post processing - redirect rules
7:58:01 PM: Caching artifacts
7:58:01 PM: Started saving workspace api node modules
7:58:01 PM: Finished saving workspace api node modules
7:58:01 PM: Started saving workspace web node modules
7:58:01 PM: Finished saving workspace web node modules
7:58:01 PM: Started saving workspace root node modules
7:58:01 PM: Finished saving workspace root node modules
7:58:01 PM: Started saving build plugins
7:58:01 PM: Finished saving build plugins
7:58:01 PM: Started saving yarn cache
7:58:01 PM: Finished saving yarn cache
7:58:01 PM: Started saving pip cache
7:58:01 PM: Post processing done
7:58:01 PM: Finished saving pip cache
7:58:01 PM: Started saving emacs cask dependencies
7:58:01 PM: Finished saving emacs cask dependencies
7:58:01 PM: Started saving maven dependencies
7:58:01 PM: Finished saving maven dependencies
7:58:01 PM: Started saving boot dependencies
7:58:01 PM: Finished saving boot dependencies
7:58:01 PM: Started saving rust rustup cache
7:58:01 PM: Finished saving rust rustup cache
7:58:01 PM: Site is live ✨
7:58:01 PM: Started saving go dependencies
7:58:01 PM: Finished saving go dependencies
7:58:01 PM: Build script success
7:58:53 PM: Finished processing build request in 4m30.650829088s

The parts that stand out the most are:

7:57:03 PM: We could not prerender all your pages, but your Redwood app should still work fine.

Nope, not true. Without migrations the app does not work fine 😉 😄

7:58:01 PM: Site is live ✨
7:58:01 PM: Started saving go dependencies
7:58:01 PM: Finished saving go dependencies
7:58:01 PM: Build script success

Live, and broken... 🙁 I don't think the build script should report success when prerendering fails and when the migrations haven't run.

I talked to @dac09 about this and his response was:

I gotta work on improving these messages ... I honestly don't like how prerender behaves with these errors but yeah I think your exit code thing is a legit bug

For comparison, this is what it looks like when it's successful (just the part with the migrations, plus some extra lines for context)

10:42:10 PM: [20:42:10] Building "web"... [completed]
10:42:10 PM: [20:42:10] Prerendering "web"... [started]
10:42:10 PM: [20:42:10] Prerendering "web"... [skipped]
10:42:10 PM: [20:42:10] → You have not marked any routes as `prerender` in `Routes.{js,tsx}`
10:42:11 PM: $ /opt/build/repo/node_modules/.bin/rw prisma migrate deploy
10:42:13 PM: 
10:42:13 PM: Running Prisma CLI:
10:42:13 PM: yarn prisma migrate deploy --schema "/opt/build/repo/api/prisma/schema.prisma"
10:42:14 PM: Prisma schema loaded from prisma/schema.prisma
10:42:14 PM: Datasource "DS": PostgreSQL database "f9b1rpaigwa972", schema "public" at "ec2-3-331-267-47.compute-1.amazonaws.com:5432"
10:42:15 PM: 33 migrations found in prisma/migrations
10:42:16 PM: The following migrations have been applied:
10:42:16 PM: migrations/
10:42:16 PM:   └─ 20210531114533_objectives/
10:42:16 PM:     └─ migration.sql
10:42:16 PM:   └─ 20210531160444_objective_status_enum/
10:42:16 PM:     └─ migration.sql
10:42:16 PM:   └─ 20210531175200_objective_optional_support/
10:42:16 PM:     └─ migration.sql
10:42:16 PM: All migrations have been successfully applied.
10:42:17 PM: $ /opt/build/repo/node_modules/.bin/rw dataMigrate up
10:42:21 PM: 
10:42:21 PM: No data migrations run, already up-to-date.
10:42:21 PM: 
10:42:21 PM: Done in 53.98s.
10:42:22 PM: yarn run v1.22.4
10:42:22 PM: $ /opt/build/repo/node_modules/.bin/rw prisma db seed
10:42:24 PM: 
10:42:24 PM: Running Prisma CLI:
10:42:24 PM: yarn prisma db seed --preview-feature --schema "/opt/build/repo/api/prisma/schema.prisma"
10:42:25 PM: Prisma schema loaded from prisma/schema.prisma
10:42:25 PM: Running node "prisma/seed.js" ...
10:42:30 PM: 🌱  Your database has been seeded.
thedavidprice commented 3 years ago

For this case, we need the prerender command to throw with the correct error code, which will Fail the deployment. @dac09 Maybe you could approach this a couple of ways: