nexus-prisma: nexus-prisma types undefined when deploying to heroku

When deploying to heroku the app crashes with the error seen in the screenshot. local build works without any problems.

Screenshot

Heroku-deployment-not-working

Description

parts of my package.json file:

"scripts": {
    "start": "node .build/api/app.js",
    "postinstall": "prisma generate",
    "build": "tsc",
},
"dependencies": {
    "@prisma/client": "2.27.0",
    "apollo-server": "^2.25.2",
    "aws-sdk": "^2.939.0",
    "bcrypt": "^5.0.1",
    "cuid": "^2.1.8",
    "graphql": "^15.5.1",
    "graphql-middleware": "^6.0.10",
    "graphql-shield": "^7.5.0",
    "jsonwebtoken": "^8.5.1",
    "nexus": "^1.1.0",
    "nexus-prisma": "^0.30.0"
  },
 "devDependencies": {
    "typescript": "^4.3.5",
  },

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 22 (7 by maintainers)

Most upvoted comments

No. It’s installed as dependency.

"dependencies": {
    "@prisma/client": "2.30.3",
    "date-fns": "2.23.0",
    "dotenv": "10.0.0",
    "envalid": "7.2.1",
    "fastify": "3.20.2",
    "fastify-plugin": "3.0.0",
    "graphql": "15.5.2",
    "mercurius": "8.1.3",
    "nexus": "1.1.0",
    "nexus-prisma": "0.31.0",
    "pino-colada": "2.1.0"
  },
  "devDependencies": {
    "@types/jest": "27.0.1",
    "@types/node": "16.7.10",
    "@typescript-eslint/eslint-plugin": "4.30.0",
    "@typescript-eslint/parser": "4.30.0",
    "eslint": "7.32.0",
    "eslint-config-prettier": "8.3.0",
    "eslint-plugin-jest": "24.4.0",
    "eslint-plugin-node": "11.1.0",
    "eslint-plugin-promise": "5.1.0",
    "eslint-plugin-unicorn": "35.0.0",
    "husky": "7.0.2",
    "jest": "27.1.0",
    "lint-staged": "11.1.2",
    "nodemon": "2.0.12",
    "prettier": "2.3.2",
    "prisma": "2.30.3",
    "ts-jest": "27.0.5",
    "ts-node": "10.2.1",
    "typescript": "4.4.2"
  },

no idea why it gets pruned

Would just like to follow up on this issue, was having the same production deploy error as above, using Dokku: TypeError: Cannot read property '$name' of undefined

Was able to fix it by setting YARN_PRODUCTION=false as mentioned, although long term would like to not have to use this flag - any updates on this weird interaction?

Running into a potentially similar issue as well: Type error: Module '"nexus-prisma"' has no exported member 'Model' within the github action runner. I know this is still in early stages of development but wanted to report it.