Skip to content

Error building backend docker image : The inferred type of 'prisma' cannot be named without a reference #538

Description

@spatcho

Got this error :

@dundring/backend:build: src/db.ts(24,14): error TS2742: The inferred type of 'prisma' cannot be named without a reference to '@dundring/database/node_modules/@prisma/client/runtime/library'. This is likely not portable. A type annotation is necessary.

Fixed it that way :

diff --git a/apps/backend/src/db.ts b/apps/backend/src/db.ts
--- a/apps/backend/src/db.ts
+++ b/apps/backend/src/db.ts
@@ -22,5 +22,5 @@
   Workout,
 } from '@dundring/database';
-export const prisma = new PrismaClient();
+export const prisma : PrismaClient = new PrismaClient();
 
 export const getUser = async (

Patch file attached

dundring-21-16-59.patch

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions