graphql-nexus / nexus-prisma

Prisma plugin for Nexus
https://graphql-nexus.github.io/nexus-prisma
MIT License
561 stars 45 forks source link

nexus-prisma generator gets stuck on mac m1 #186

Open jcbdev opened 2 years ago

jcbdev commented 2 years ago

This relates to closed issue https://github.com/prisma/nexus-prisma/issues/30

OS: MacOS Monteray (M1) Prisma version: 3.8.1 nexus-prisma version: 0.36.0-next.1

Description

Running npx prisma generate just stops processing and never completes

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma

Here are the logs with DEBUG=* turned on

prisma:loadEnv project root found at /Users/tssc/Projects/tst1/package.json +0ms
  prisma:tryLoadEnv Environment variables loaded from /Users/tssc/Projects/tst1/.env +0ms
Environment variables loaded from .env
  prisma:engines binaries to download libquery-engine, migration-engine, introspection-engine, prisma-fmt +0ms
Prisma schema loaded from prisma/schema.prisma
  prisma:getConfig Using CLI Query Engine (Node-API Library) at: /Users/tssc/Projects/tst1/node_modules/prisma/libquery_engine-darwin-arm64.dylib.node +0ms
  prisma:getDMMF Using CLI Query Engine (Node-API) at: /Users/tssc/Projects/tst1/node_modules/prisma/libquery_engine-darwin-arm64.dylib.node +0ms
  prisma:generator prismaCLIDir /Users/tssc/Projects/tst1/node_modules/prisma +0ms
  prisma:generator prismaClientDir /Users/tssc/Projects/tst1/node_modules/@prisma/client +0ms
  prisma:generator baseDir /Users/tssc/Projects/tst1/prisma +0ms
  prisma:generator typescriptPath /Users/tssc/Projects/tst1/node_modules/typescript +1ms
  nexus-prisma found outputSourceDir /Users/tssc/Projects/tst1/node_modules/nexus-prisma/dist-esm/runtime +0ms
  nexus-prisma found outputSourceDir /Users/tssc/Projects/tst1/node_modules/nexus-prisma/dist-cjs/runtime +2ms
  prisma:GeneratorProcess 2022-01-27T00:44:18.721Z prisma:client:generator requiredEngine: libqueryEngine +0ms
  prisma:getGenerators neededVersions {
  "34df67547cf5598f5a6cd3eb45f14ee70c3fb86f": {
    "engines": [
      "libqueryEngine"
    ],
    "binaryTargets": []
  }
} +0ms
  prisma:getGenerators {
  prisma:getGenerators   generatorBinaryPaths: {
  prisma:getGenerators     libqueryEngine: {
  prisma:getGenerators       'darwin-arm64': '/Users/tssc/Projects/tst1/node_modules/prisma/libquery_engine-darwin-arm64.dylib.node'
  prisma:getGenerators     }
  prisma:getGenerators   }
  prisma:getGenerators } +46ms
  prisma:GeneratorProcess 2022-01-27T00:44:18.942Z prisma:loadEnv project root found at /Users/tssc/Projects/tst1/package.json +221ms

it never moves on from here.

khuezy commented 2 years ago

Duplicate of https://github.com/prisma/nexus-prisma/issues/185

I've also experienced the same issue; had to downgrade to 0.34.0

Nedomas commented 2 years ago

This is not a m1 issue as I'm running it on a non-m1 mac and can reproduce it. Can also confirm that 0.34.0 does not have this issue.

bastianhilton commented 2 years ago

I"m on Windows 11 and can confirm that 0.35.0 is having similar issues where it just hangs, but the issue isn't here when downgrading to 0.34.0

lovetofail commented 2 years ago

Downgrading to 0.34.0 didn't help. Had to downgrade graphql-yoga to "^1.18.3". Then it worked. Windows 10. My dependencies:

"dependencies": {
    "@devoxa/prisma-relay-cursor-connection": "^1.1.1",
    "@parse/node-apn": "^4.0.0",
    "@prisma/client": "^4.1.1",
    "@types/lodash": "^4.14.168",
    "@types/pako": "^1.0.1",
    "@types/ws": "^7.4.0",
    "bull": "^3.20.1",
    "bull-board": "^1.4.1",
    "firebase-admin": "^9.5.0",
    "graphql-shield": "^7.5.0",
    "graphql-yoga": "^1.18.3",
    "nexus": "^1.3.0",
    "nexus-prisma": "^0.35.0",
    "pako": "^2.0.3",
    "rate-limiter-flexible": "^2.2.1",
    "rxjs": "^6.6.6"
  }
Nedomas commented 2 years ago

Update:

For everybody that we're stuck on this, it was nexus-prisma eating up dependency missing error. nexus-prisma uses floggy as a dependency, and they have a problem with the chalk dependency (here). To fix it, install chalk v4 as a dependency manually:

yarn add chalk@4