Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment to Now 2.0 fails with: " Property 'model' does not exist on type 'ObjectDefinitionBlock<"MODEL">" #523

Closed
nikolasburk opened this issue Nov 7, 2019 · 20 comments
Labels
needs/investigation Possibly an issue, needs more analysis/research

Comments

@nikolasburk
Copy link
Contributor

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?

@iRoachie
Copy link

iRoachie commented Nov 7, 2019

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"

@nikolasburk
Copy link
Contributor Author

Thanks a lot @iRoachie. I adjusted the build script but am still seeing the same issue upon running yarn build as well as when deploying with now 🤔

@iRoachie
Copy link

iRoachie commented Nov 7, 2019

Okay I may have missed this line:

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'.

I encountered this yesterday after bumping my typescript version. I've since had to resort to pinning "typescript": "3.6.4".

@jasonkuhrt
Copy link
Member

jasonkuhrt commented Nov 7, 2019

Hey @nikolasburk Can you try with TS 3.6.x.

@jasonkuhrt jasonkuhrt added the needs/investigation Possibly an issue, needs more analysis/research label Nov 7, 2019
@nikolasburk
Copy link
Contributor Author

nikolasburk commented Nov 7, 2019

hmm, I'm still seeing the same issue, even after downgrading... just for reference, this is my package.json:

{
  "name": "graphql-auth",
  "license": "MIT",
  "scripts": {
    "start": "node dist/server",
    "clean": "rm -rf dist",
    "build": "npm -s run clean && NEXUS_SHOULD_GENERATE_ARTIFACTS=true npm -s run generate && tsc",
    "generate": "npm -s run generate:prisma && npm -s run generate:nexus",
    "generate:prisma": "prisma2 generate",
    "generate:nexus": "ts-node --transpile-only src/schema",
    "postinstall": "npm -s run generate",
    "dev": "ts-node-dev --no-notify --respawn --transpileOnly src/server",
    "seed": "ts-node prisma/seed"
  },
  "dependencies": {
    "bcryptjs": "2.4.3",
    "graphql": "14.5.8",
    "graphql-shield": "5.7.3",
    "graphql-yoga": "1.18.3",
    "jsonwebtoken": "8.5.1",
    "nexus": "0.12.0-rc.4",
    "nexus-prisma": "0.5.0"
  },
  "devDependencies": {
    "@prisma/sdk": "0.0.21",
    "@types/bcryptjs": "2.4.2",
    "@types/jsonwebtoken": "8.3.5",
    "@types/node": "12.12.6",
    "@types/ws": "6.0.3",
    "prisma2": "2.0.0-preview015",
    "ts-node": "8.4.1",
    "ts-node-dev": "1.0.0-pre.44",
    "typescript": "3.6.4"
  },
  "prettier": {
    "singleQuote": true,
    "semi": false,
    "trailingComma": "all"
  }
}

I also ran:

rm -rf node_modules yarn.lock
yarn

Also note that it the app is working when I'm running yarn dev. It's just yarn build that's causing this issue:

$ yarn dev
yarn run v1.19.1
$ ts-node-dev --no-notify --respawn --transpileOnly src/server
Using ts-node version 8.4.1, typescript version 3.6.4
You should specify a configuration value for outputs in Nexus' makeSchema. Provide one to remove this warning.
🚀 Server ready at: http://localhost:4000
⭐️ See sample queries: http://pris.ly/e/ts/graphql-auth#5-using-the-graphql-api
^C⏎
$ yarn build
yarn run v1.19.1
$ npm -s run clean && NEXUS_SHOULD_GENERATE_ARTIFACTS=true npm -s run generate && tsc
> Downloading darwin binary for query-engine [====================] 100%

Generating Photon.js to /Users/nikolasburk/Desktop/heroku-db-connections/node_modules/@generated/photon
Done in 2.67s

You should specify a configuration value for outputs in Nexus' makeSchema. Provide one to remove this warning.
node_modules/nexus-prisma/dist/index.d.ts:36:92 - error TS2694: Namespace '"/Users/nikolasburk/Desktop/heroku-db-connections/node_modules/nexus/dist/plugins/index"' has no exported member 'PluginDef'.

36 export declare function nexusPrismaPlugin(options?: Options): import("nexus/dist/plugins").PluginDef;
                                                                                              ~~~~~~~~~

src/types/Post.ts:6:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.

6     t.model.id()
        ~~~~~

src/types/Post.ts:9:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.

9     t.model.published()
        ~~~~~

src/types/Post.ts:10:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.

10     t.model.title()
         ~~~~~

src/types/Post.ts:11:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.

11     t.model.content()
         ~~~~~

src/types/Post.ts:12:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.

12     t.model.author()
         ~~~~~

src/types/User.ts:6:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.

6     t.model.id()
        ~~~~~

src/types/User.ts:7:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.

7     t.model.name()
        ~~~~~

src/types/User.ts:8:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.

8     t.model.email()
        ~~~~~

src/types/User.ts:9:7 - error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.

9     t.model.posts({ pagination: false })
        ~~~~~


Found 10 errors.

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@nikolasburk
Copy link
Contributor Author

Here's a zipped version of the project in case it's interests anyone 😄 I've remove the password from the DB connection string but feel free to ping me in a DM to get it.
heroku-db-connections.zip

@jasonkuhrt
Copy link
Member

Hey @nikolasburk, can you please use "nexus": "^0.12.0-beta.14",. The newer versions of Nexus do not support the should generate environment variable.

@iRoachie
Copy link

iRoachie commented Nov 7, 2019

Looks like that works. The only weird thing I found is that yarn would still install a nested version of 0.12.0-rc.4 that wouldn't remove even if rm -rf node_modules yarn.lock.

So ended up having to use the resolutions field to force the correct version:

"resolutions": {
  "nexus": "0.12.0-beta.14"
}

@jasonkuhrt
Copy link
Member

I just published 0.5.1. Can you please try with that and follow the note about environment variables https://github.com/prisma-labs/nexus-prisma/releases/tag/v0.5.1.

@michaelspeed
Copy link

this is still ongoing!, i am getting this even after downgrading the error is -

/Volumes/SYS_ADMIN/projects/oncall/oncall-prisma/oncallPrisma/node_modules/nexus-prisma/src/index.ts:39
  return plugin({
         ^
TypeError: nexus_1.plugin is not a function
    at Object.nexusPrismaPlugin (/Volumes/SYS_ADMIN/projects/oncall/oncall-prisma/oncallPrisma/node_modules/nexus-prisma/src/index.ts:39:10)
    at Object.<anonymous> (/Volumes/SYS_ADMIN/projects/oncall/oncall-prisma/oncallPrisma/src/schema.ts:7:13)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Module.m._compile (/Volumes/SYS_ADMIN/projects/oncall/oncall-prisma/oncallPrisma/node_modules/ts-node/src/index.ts:493:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Object.require.extensions.<computed> [as .ts] (/Volumes/SYS_ADMIN/projects/oncall/oncall-prisma/oncallPrisma/node_modules/ts-node/src/index.ts:496:12)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
    at Object.<anonymous> (/Volumes/SYS_ADMIN/projects/oncall/oncall-prisma/oncallPrisma/node_modules/ts-node/src/bin.ts:158:12)

@jasonkuhrt
Copy link
Member

Hey @michaelspeed that error seems to indicate you are not using the latest version of Nexus.

@Fonz001
Copy link

Fonz001 commented Nov 14, 2019

Switching from 0.12.0-rc.4 to 0.12.0-beta.14 in package.json fixed it for me.

@lvnr
Copy link

lvnr commented Dec 4, 2019

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.

@nvsd
Copy link

nvsd commented Dec 31, 2019

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.

This worked for me!
Thanks @lvnr
I did have to add "esModuleInterop": true to my tsconfig.json for use with apollo though.

@amed
Copy link

amed commented Jul 13, 2020

Still happening on 0.16.1

@leo-petrucci
Copy link

Hello, I'm experiencing the same problem. None of the fixes mentioned in this thread worked. I couldn't try the fix posted by @lvnr as the link seems to be dead.

Any chance we could open this again? The repository in question is this one.

Build works locally, but refuses to complete when deploying on Vercel, here's my log.


22:35:08.889 | Cloning github.com/creativiii/mci-backend (Branch: master, Commit: 5df9b46)
-- | --
22:35:09.997 | Cloning completed in 1108ms
22:35:09.998 | Analyzing source code...
22:35:10.568 | Installing build runtime...
22:35:10.953 | Build runtime installed: 384.722ms
22:35:11.360 | Looking up build cache...
22:35:11.413 | Build cache not found
22:35:11.829 | Installing dependencies...
22:35:23.295 | > @prisma/cli@2.6.2 preinstall /vercel/f003e2c/node_modules/@prisma/cli
22:35:23.295 | > node preinstall/index.js
22:35:23.726 | > @prisma/cli@2.6.2 install /vercel/f003e2c/node_modules/@prisma/cli
22:35:23.726 | > node download-build/index.js
22:35:24.099 | > core-js@2.6.11 postinstall /vercel/f003e2c/node_modules/core-js
22:35:24.099 | > node -e "try{require('./postinstall')}catch(e){}"
22:35:24.159 | �[96mThank you for using core-js (�[94m https://github.com/zloirock/core-js �[96m) for polyfilling JavaScript standard library!�[0m
22:35:24.159 | �[96mThe project needs your help! Please consider supporting of core-js on Open Collective or Patreon: �[0m
22:35:24.159 | �[96m>�[94m https://opencollective.com/core-js �[0m
22:35:24.159 | �[96m>�[94m https://www.patreon.com/zloirock �[0m
22:35:24.159 | �[96mAlso, the author of core-js (�[94m https://github.com/zloirock �[96m) is looking for a good job -)�[0m
22:35:24.226 | > @prisma/client@2.6.2 postinstall /vercel/f003e2c/node_modules/@prisma/client
22:35:24.226 | > node scripts/postinstall.js
22:35:26.762 | ✔ Generated Prisma Client to ./node_modules/@prisma/client in 62ms
22:35:26.762 | You can now start using Prisma Client in your code:
22:35:26.762 | ```
22:35:26.762 | import { PrismaClient } from '@prisma/client'
22:35:26.762 | // or const { PrismaClient } = require('@prisma/client')
22:35:26.762 | const prisma = new PrismaClient()
22:35:26.762 | ```
22:35:26.763 | Explore the full API: http://pris.ly/d/client
22:35:26.919 | > @prisma/sdk@2.6.2 postinstall /vercel/f003e2c/node_modules/@prisma/sdk
22:35:26.919 | > node scripts/download.js
22:35:27.108 | version: 6a8054bb549e4cc23f157b0010cb2e95cb2637fb
22:35:29.007 | > nexus-plugin-prisma@0.18.2 postinstall /vercel/f003e2c/node_modules/nexus-plugin-prisma
22:35:29.007 | > node ./scripts/postinstall.js
22:35:29.803 | npm WARN prisma-backend@ No repository field.
22:35:29.806 | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fsevents):
22:35:29.806 | npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
22:35:29.809 | added 992 packages from 615 contributors in 17.531s
22:35:30.182 | 30 packages are looking for funding
22:35:30.182 | run `npm fund` for details
22:35:30.631 | > prisma-backend@ build /vercel/f003e2c
22:35:30.631 | > npm -s run clean && npm -s run generate && tsc
22:35:33.072 | ✔ Generated Prisma Client to ./node_modules/@prisma/client in 61ms
22:35:33.072 | You can now start using Prisma Client in your code:
22:35:33.072 | ```
22:35:33.072 | import { PrismaClient } from '@prisma/client'
22:35:33.072 | // or const { PrismaClient } = require('@prisma/client')
22:35:33.072 | const prisma = new PrismaClient()
22:35:33.073 | ```
22:35:33.073 | Explore the full API: http://pris.ly/d/client
22:35:39.350 | src/types/Server.ts(6,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Server">'.
22:35:39.351 | src/types/Server.ts(7,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Server">'.
22:35:39.351 | src/types/Server.ts(8,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Server">'.
22:35:39.351 | src/types/Server.ts(9,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Server">'.
22:35:39.351 | src/types/Server.ts(10,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Server">'.
22:35:39.351 | src/types/Server.ts(11,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Server">'.
22:35:39.351 | src/types/Server.ts(12,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Server">'.
22:35:39.351 | src/types/Server.ts(13,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Server">'.
22:35:39.351 | src/types/Server.ts(14,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Server">'.
22:35:39.351 | src/types/Tag.ts(7,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Tag">'.
22:35:39.351 | src/types/Tag.ts(8,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Tag">'.
22:35:39.351 | src/types/Tag.ts(9,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Tag">'.
22:35:39.351 | src/types/User.ts(6,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
22:35:39.351 | src/types/User.ts(7,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
22:35:39.351 | src/types/User.ts(8,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
22:35:39.351 | src/types/User.ts(9,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
22:35:39.351 | src/types/User.ts(10,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
22:35:39.351 | src/types/User.ts(11,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
22:35:39.352 | src/types/User.ts(12,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
22:35:39.352 | src/types/User.ts(13,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
22:35:39.352 | src/types/Version.ts(6,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Version">'.
22:35:39.352 | src/types/Version.ts(7,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Version">'.
22:35:39.352 | src/types/Version.ts(8,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Version">'.
22:35:39.352 | src/types/Vote.ts(7,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Vote">'.
22:35:39.352 | src/types/Vote.ts(8,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Vote">'.
22:35:39.352 | src/types/Vote.ts(9,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Vote">'.
22:35:39.363 | npm ERR! code ELIFECYCLE
22:35:39.363 | npm ERR! errno 2
22:35:39.365 | npm ERR! prisma-backend@ build: `npm -s run clean && npm -s run generate && tsc`
22:35:39.365 | npm ERR! Exit status 2
22:35:39.365 | npm ERR!
22:35:39.365 | npm ERR! Failed at the prisma-backend@ build script.
22:35:39.365 | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
22:35:39.370 | npm ERR! A complete log of this run can be found in:
22:35:39.370 | npm ERR!     /vercel/.npm/_logs/2020-09-17T21_35_39_365Z-debug.log
22:35:39.375 | Error: Command "npm run build" exited with 2
22:35:41.308 | Done with "package.json"

@davidhlee
Copy link

Any update on this @creativiii ? I'm running into this issue on heroku as well. I'm getting Property 'crud' does not exist on type 'ObjectDefinitionBlock<"Mutation">.

@leo-petrucci
Copy link

Any update on this @creativiii ? I'm running into this issue on heroku as well. I'm getting Property 'crud' does not exist on type 'ObjectDefinitionBlock<"Mutation">.

In my situation I think I thought I was exporting lambda functions, but I don't think I was. I think that was the problem I was having.

I tried switching to GraphQL lambda as a server, unfortunately I then encountered a completely different bug.

So no, no progress. I don't even know if the above error is caused by not exporting as lambda or not, sorry.

@GolfredoPerezFernandez
Copy link

same here.. version 0.17.0

@domnantas
Copy link

domnantas commented Dec 2, 2020

Encountering this issue when deploying on Heroku. Locally, the same commands work perfectly.
Output:

-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false
       
-----> Installing binaries
       engines.node (package.json):  >=10.0.0
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version >=10.0.0...
       Downloading and installing node 15.3.0...
       Using default npm version: 7.0.14
       
-----> Restoring cache
       - node_modules
       
-----> Installing dependencies
       Installing node modules
       
       added 312 packages, and audited 312 packages in 17s
       
       found 0 vulnerabilities
       
-----> Build
       Running build
       
       > build
       > npm -s run clean && npm -s run generate && tsc
       
       
       Prisma schema loaded from prisma/schema.prisma
       
       ✔ Generated Prisma Client (2.12.1) to ./node_modules/@prisma/client in 83ms
       You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
       ```
       import { PrismaClient } from '@prisma/client'
       const prisma = new PrismaClient()
       ```
       
       warn Prisma 2.12.0 has breaking changes.
       You can update your code with npx @prisma/codemods update-2.12 ./
       Read more at https://pris.ly/2.12
       src/schema.ts(7,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
       src/schema.ts(8,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
       src/schema.ts(9,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
       src/schema.ts(10,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
       src/schema.ts(19,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
       src/schema.ts(20,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
       src/schema.ts(21,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
       src/schema.ts(22,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
       src/schema.ts(23,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
       src/schema.ts(24,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
       src/schema.ts(31,7): error TS2339: Property 'crud' does not exist on type 'ObjectDefinitionBlock<"Query">'.
       src/schema.ts(64,7): error TS2339: Property 'crud' does not exist on type 'ObjectDefinitionBlock<"Mutation">'.
       src/schema.ts(65,7): error TS2339: Property 'crud' does not exist on type 'ObjectDefinitionBlock<"Mutation">'.
npm ERR! code 2
npm ERR! path /tmp/build_f3d5bd27_
npm ERR! command failed
npm ERR! command sh -c npm -s run clean && npm -s run generate && tsc
npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/npmcache.E3Y6i/_logs/2020-12-02T02_06_51_639Z-debug.log
-----> Build failed
       
       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       
       Some possible problems:
       
       - Dangerous semver range (>) in engines.node
         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
       
       Love,
       Heroku
       
 !     Push rejected, failed to compile Node.js app.
 !     Push failed

package.json

{
  "name": "typescript-graphql",
  "scripts": {
    "start": "node dist/server",
    "clean": "rm -rf dist",
    "postinstall": "npm run build",
    "build": "npm -s run clean && npm -s run generate && tsc",
    "generate": "npm -s run generate:prisma && npm -s run generate:nexus",
    "generate:prisma": "prisma generate",
    "generate:nexus": "ts-node --transpile-only src/schema",
    "lift:up": "prisma migrate up --experimental",
    "lift:save": "prisma migrate save --experimental",
    "dev": "ts-node-dev --no-notify --respawn --transpileOnly src/server"
  },
  "dependencies": {
    "@nexus/schema": "0.19.2",
    "@prisma/cli": "2.12.1",
    "@prisma/client": "2.12.1",
    "@types/node-fetch": "2.5.7",
    "apollo-server": "2.19.0",
    "graphql": "15.4.0",
    "nexus-plugin-prisma": "0.25.0"
  },
  "devDependencies": {
    "@types/node": "12.19.8",
    "ts-node": "9.0.0",
    "ts-node-dev": "1.0.0-pre.50",
    "typescript": "4.1.2"
  },
  "prettier": {
    "singleQuote": true,
    "semi": false,
    "trailingComma": "all"
  },
  "engines": {
    "node": ">=10.0.0"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/investigation Possibly an issue, needs more analysis/research
Projects
None yet
Development

No branches or pull requests