graphql-nexus / nexus-plugin-prisma

Deprecated
MIT License
829 stars 118 forks source link

Error on nexus build #761

Open alanstriglio opened 4 years ago

alanstriglio commented 4 years ago

Hello, I'm using Nexus 0.26.0-next.7 on Windows machine.

When I run the command npx nexus build Nexus is not able to build the application and return the following errors:

● nexus:build compiling a production build
node_modules/@types/typegen-nexus-plugin-prisma/index.d.ts:2:25 - error TS2307: Cannot find module '.....prismaclient' or its corresponding type declarations.

2 import * as Prisma from '..\..\.prisma\client';
                          ~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/typegen-nexus/index.d.ts:6:13 - error TS2300: Duplicate identifier 'Prisma'.

6 import * as Prisma from "../../.prisma/client/index"
              ~~~~~~
node_modules/@types/typegen-nexus/index.d.ts:11:13 - error TS2300: Duplicate identifier 'Prisma'.

11 import * as Prisma from "..\..\.prisma\client\index"
               ~~~~~~
node_modules/@types/typegen-nexus/index.d.ts:11:25 - error TS2307: Cannot find module '.....prismaclientindex' or its corresponding type declarations.

11 import * as Prisma from "..\..\.prisma\client\index"
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@types/typegen-nexus-plugin-prisma/index.d.ts:2:25 - error TS2307: Cannot find module '.....prismaclient' or its corresponding type declarations.

2 import * as Prisma from '..\..\.prisma\client';
                          ~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/typegen-nexus/index.d.ts:6:13 - error TS2300: Duplicate identifier 'Prisma'.

6 import * as Prisma from "../../.prisma/client/index"
              ~~~~~~
node_modules/@types/typegen-nexus/index.d.ts:11:13 - error TS2300: Duplicate identifier 'Prisma'.

11 import * as Prisma from "..\..\.prisma\client\index"
               ~~~~~~
node_modules/@types/typegen-nexus/index.d.ts:11:25 - error TS2307: Cannot find module '.....prismaclientindex' or its corresponding type declarations.       

11 import * as Prisma from "..\..\.prisma\client\index"
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    at Object.emitTSProgram (D:\test\nexus-prisma-plugin\node_modules\nexus\src\lib\tsc.ts:109:11)
    at Object.buildNexusApp (D:\test\nexus-prisma-plugin\node_modules\nexus\src\lib\build\build.ts:97:3)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Build.parse (D:\test\nexus-prisma-plugin\node_modules\nexus\src\cli\commands\build.ts:35:5)

npx nexus dev works perfectly.

Japneet15597 commented 4 years ago

I am also facing the same issue.

sakettawde commented 4 years ago

+1 same issue being face by me

for reference

"dependencies": { "@types/cors": "^2.8.6", "@types/node": "^14.0.13", "cors": "^2.8.5", "nexus": "^0.26.0", "nexus-plugin-prisma": "^0.17.0", "node-fetch": "^2.6.0", "ts-node": "^8.10.2", "typescript": "^3.8.3" }