When deploying to Heroku i got this error: ```remo...
# graphql-nexus
t
When deploying to Heroku i got this error:
Copy code
remote: Type error: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
remote: 
remote:   19 |   name: 'User',
remote:   20 |   definition(t) {
remote: > 21 |     t.model.id()
remote:      |       ^
Maybe this connected with @nexus/schema or nexus-plugin-prisma?
Copy code
"nexus-plugin-prisma": "^0.19.0",
"@nexus/schema": "^0.16.0",
r
Probably your
NODE_ENV
is set to production and Nexus is not generating the types, but could you check your logs and see if that’s the case?
t
Copy code
"scripts": {
    "start": "next start -p $PORT",
    "dev": "next dev",
    "build": "next build",
    "studio": "npx prisma studio",
    "generate": "npm -s run generate:prisma && npm -s run generate:nexus",
    "generate:prisma": "prisma generate",
    "generate:nexus": "ts-node --transpile-only -P nexus.tsconfig.json src/graphql/schema",
    "lint": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
    "postinstall": "npm run generate"
  },
ok, i try to set mode to
dev
changed to this
"generate:nexus": "NODE_ENV=development ts-node --transpile-only -P nexus.tsconfig.json src/graphql/schema"
and deploy succeeded
🙌 1
r
Awesome!
t
And deploy to Vercel works without
NODE_ENV=development
d
whats the
nexus.tsconfig.json
?
t
Copy code
{
  "compilerOptions": {
    "sourceMap": true,
    "outDir": "dist",
    "strict": true,
    "lib": [
      "esnext"
    ],
    "esModuleInterop": true
  }
}