Nexus-plugin-prisma: xs.reduce is not a function on server startup

Created on 28 Oct 2020  路  8Comments  路  Source: graphql-nexus/nexus-plugin-prisma

I get the following error when I run the server:

TypeError: xs.reduce is not a function
    at Object.exports.indexBy (node_modules/nexus-plugin-prisma/src/utils.ts:66:15)
    at new DmmfDocument (node_modules/nexus-plugin-prisma/src/dmmf/DmmfDocument.ts:30:26)
    at Object.exports.getTransformedDmmf (node_modules/nexus-plugin-prisma/src/dmmf/transformer.ts:16:20)
    at new SchemaBuilder (node_modules/nexus-plugin-prisma/src/builder.ts:256:7)
    at Object.build (node_modules/nexus-plugin-prisma/src/builder.ts:175:19)
    at Object.onInstall (node_modules/nexus-plugin-prisma/src/plugin.ts:46:62)
    at node_modules/@nexus/schema/src/builder.ts:657:44
    at Array.forEach (<anonymous>)
    at SchemaBuilder.beforeWalkTypes (node_modules/@nexus/schema/src/builder.ts:651:18)
    at SchemaBuilder.getFinalTypeMap (node_modules/@nexus/schema/src/builder.ts:741:10)

Versions:

  • nexus-plugin-prisma: 0.22.0
  • @prisma/client: 2.10.0
  • @nexus/schema: 0.16.0

Most helpful comment

I encountered this issue when using one of the prisma graphql examples (https://github.com/prisma/prisma-examples/tree/latest/typescript/graphql). It worked for me after updating dependencies to the newest packages.

OLD
"@nexus/schema": "0.16.0",
"@prisma/client": "^2.8.1",
"nexus-plugin-prisma": "^0.21.0"

NEW
"@nexus/schema": "^0.17.0",
"@prisma/client": "^2.10.0",
"nexus-plugin-prisma": "^0.23.0"

All 8 comments

Also having this problem. Keeping an eye on this and 913. Thanks for opening the issue, I thought I was doing something wrong.

  • nexus-plugin-prisma: 0.22.0
  • @nexus/schema: 0.16.0
  • @prisma/client: 2.10.0

Also having this problem, but with @prisma/client version 2.9.0.

I've performed a clean install but the issue persists.

I encountered this issue when using one of the prisma graphql examples (https://github.com/prisma/prisma-examples/tree/latest/typescript/graphql). It worked for me after updating dependencies to the newest packages.

OLD
"@nexus/schema": "0.16.0",
"@prisma/client": "^2.8.1",
"nexus-plugin-prisma": "^0.21.0"

NEW
"@nexus/schema": "^0.17.0",
"@prisma/client": "^2.10.0",
"nexus-plugin-prisma": "^0.23.0"

@MitchellMonaghan Thanks! Updating dependencies to the latest seems to fix it.

Was having the same issue, with the same dep versions as @MitchellMonaghan. Upgrade also cleared it up :+1:

I'm having the same issue:
"@nexus/schema": "^0.18.0",
"@prisma/client": "^2.12.0",
"nexus-plugin-prisma": "^0.24.0",

There has to be a bug somewhere in this library.

Was this page helpful?
0 / 5 - 0 ratings