nexus-plugin-prisma: Deployment to Now 2.0 fails with: " Property 'model' does not exist on type 'ObjectDefinitionBlock<"MODEL">"

I’m trying to deploy the graphql-auth example that’s connected to a Postgres DB on Heroku to Now 2.0.

Here are the steps I took:

  1. prisma2 init
  2. Select graphql-auth starter kit & connect to Postgres DB on Heroku
  3. Run yarn build
  4. Run now
$ now
> Deploying ~/Desktop/heroku-db-connections under nikolasburk
> Using project heroku-db-connections
> Synced 4 files [1s]
> https://heroku-db-connections-o3k676rl7.now.sh [4s]
> Error! Build failed
> Error! Check your logs at https://heroku-db-connections-o3k676rl7.now.sh/_logs or run `now logs https://heroku-db-connections-o3k676rl7.now.sh`
~/D/heroku-db-connections $ now logs https://heroku-db-connections-o3k676rl7.now.sh
> Fetched deployment "heroku-db-connections-o3k676rl7.now.sh" in nikolasburk [2s]
2019-11-07T08:54:50.679Z  Installing build runtime...
2019-11-07T08:54:50.681Z  yarn info @now/build-utils@latest...
2019-11-07T08:54:50.685Z  yarn info @now/static-build...
2019-11-07T08:54:51.284Z  Build runtime installed: 605.119ms
2019-11-07T08:54:51.698Z  Looking up build cache...
2019-11-07T08:54:52.152Z  Running builder.exports.build...
2019-11-07T08:54:52.156Z  Installing dependencies...
2019-11-07T08:54:52.516Z  yarn install v1.17.3
2019-11-07T08:54:52.579Z  [1/4] Resolving packages...
2019-11-07T08:54:52.769Z  [2/4] Fetching packages...
2019-11-07T08:54:57.870Z  [3/4] Linking dependencies...
2019-11-07T08:54:57.872Z  warning " > graphql-shield@5.7.3" has unmet peer dependency "graphql-middleware@^2.0.0 || ^3.0.0".
2019-11-07T08:54:57.873Z  warning "graphql-yoga > graphql-playground-middleware-lambda@1.7.12" has unmet peer dependency "aws-lambda@^0.1.2".
2019-11-07T08:54:57.873Z  warning "graphql-yoga > graphql-subscriptions@0.5.8" has incorrect peer dependency "graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0".
2019-11-07T08:54:57.874Z  warning "graphql-yoga > apollo-server-express > apollo-server-core@1.4.0" has incorrect peer dependency "graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0".
2019-11-07T08:54:57.875Z  warning "graphql-yoga > apollo-server-express > apollo-server-core > apollo-cache-control@0.1.1" has incorrect peer dependency "graphql@0.10.x - 0.13.x".
2019-11-07T08:54:57.875Z  warning "graphql-yoga > apollo-server-express > apollo-server-core > apollo-tracing@0.1.4" has incorrect peer dependency "graphql@0.10.x - 0.13.x".
2019-11-07T08:54:57.875Z  warning "graphql-yoga > apollo-server-express > apollo-server-core > graphql-extensions@0.0.10" has incorrect peer dependency "graphql@0.10.x - 0.13.x".
2019-11-07T08:54:59.369Z  [4/4] Building fresh packages...
2019-11-07T08:55:02.898Z  $ npm -s run generate
2019-11-07T08:55:05.743Z  
2019-11-07T08:55:05.743Z  
2019-11-07T08:55:05.743Z  Generating Photon.js to /zeit/71d93fb3/node_modules/@generated/photon
2019-11-07T08:55:08.873Z  Done in 3.13s
2019-11-07T08:55:08.873Z  
2019-11-07T08:55:09.741Z  You should specify a configuration value for outputs in Nexus' makeSchema. Provide one to remove this warning.
2019-11-07T08:55:09.757Z  Done in 17.25s.
2019-11-07T08:55:09.787Z  Running "yarn run build"
2019-11-07T08:55:09.973Z  yarn run v1.17.3
2019-11-07T08:55:09.996Z  $ npm -s run clean && npm -s run generate && tsc
2019-11-07T08:55:13.026Z  
2019-11-07T08:55:13.026Z  
2019-11-07T08:55:13.026Z  Generating Photon.js to /zeit/71d93fb3/node_modules/@generated/photon
2019-11-07T08:55:16.750Z  Done in 3.72s
2019-11-07T08:55:16.750Z  
2019-11-07T08:55:17.617Z  You should specify a configuration value for outputs in Nexus' makeSchema. Provide one to remove this warning.
2019-11-07T08:55:20.412Z  node_modules/nexus-prisma/dist/index.d.ts(1,10): error TS2440: Import declaration conflicts with local declaration of 'Options'.
2019-11-07T08:55:20.413Z  node_modules/nexus-prisma/dist/index.d.ts(36,92): error TS2694: Namespace '"/zeit/71d93fb3/node_modules/nexus/dist/plugins/index"' has no exported member 'PluginDef'.
2019-11-07T08:55:20.413Z  src/types/Post.ts(6,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
2019-11-07T08:55:20.413Z  src/types/Post.ts(9,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
2019-11-07T08:55:20.413Z  src/types/Post.ts(10,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
2019-11-07T08:55:20.413Z  src/types/Post.ts(11,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
2019-11-07T08:55:20.413Z  src/types/Post.ts(12,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
2019-11-07T08:55:20.413Z  src/types/User.ts(6,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
2019-11-07T08:55:20.413Z  src/types/User.ts(7,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
2019-11-07T08:55:20.413Z  src/types/User.ts(8,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
2019-11-07T08:55:20.413Z  src/types/User.ts(9,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
2019-11-07T08:55:20.433Z  error Command failed with exit code 2.
2019-11-07T08:55:20.433Z  info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2019-11-07T08:55:20.442Z  Error: Exited with 2
2019-11-07T08:55:20.442Z      at ChildProcess.child.on (/zeit/55cfbb27218c985e/.build-utils/.builder/node_modules/@now/static-build/dist/index.js:23563:24)
2019-11-07T08:55:20.442Z      at emitTwo (events.js:126:13)
2019-11-07T08:55:20.442Z      at ChildProcess.emit (events.js:214:7)
2019-11-07T08:55:20.442Z      at maybeClose (internal/child_process.js:925:16)
2019-11-07T08:55:20.442Z      at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
2019-11-07T08:55:20.561Z  worker exited with code 20 and signal null
2019-11-07T08:55:22.940Z  done
~/D/heroku-db-connections $ now --version
16.4.4

Any idea what I need to do in order to get this to work?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 20 (7 by maintainers)

Most upvoted comments

Copying over the tsconfig.json and the scripts from package.json from this example: https://github.com/prisma-labs/nexus-prisma/blob/master/examples/blog/ as well as updating all dependencies to latest versions fixed those issues for me.

I had this problem before, but it worked after adding NEXUS_SHOULD_GENERATE_ARTIFACTS=true to the generate script.

Full build script becomes:

"build": "npm -s run clean && NEXUS_SHOULD_GENERATE_ARTIFACTS=true npm -s run generate && tsc"