Kazaz
Kazaz
PPrisma
Created by Kazaz on 4/10/2025 in #help-and-questions
Prisma 6.6.0 ESM with Nx Monorepo - Typescript type check failures
I also found this: https://www.prisma.io/docs/orm/prisma-schema/overview/generators#limitations Can this just be a bug at the moment? Even if fixed (removeing namespaces for example), why not also generate .d.ts file to resolve it?
22 replies
PPrisma
Created by Kazaz on 4/10/2025 in #help-and-questions
Prisma 6.6.0 ESM with Nx Monorepo - Typescript type check failures
@Nurul (Prisma) Shouldn't the new ESM option also generte its .d.ts files? WOuldn't that resolve the issue? https://github.com/microsoft/TypeScript/issues/40426#issuecomment-1373167253
22 replies
PPrisma
Created by Kazaz on 4/10/2025 in #help-and-questions
Prisma 6.6.0 ESM with Nx Monorepo - Typescript type check failures
I think maybe @Nurul (Prisma) could assist here? 🙂 The main problem is that the ESM option does not follow the same strict rules we follow in our repo and so this is causing us major issues. "erasableSyntaxOnly": true, "exactOptionalPropertyTypes": true, "noUnusedLocals": true
22 replies
PPrisma
Created by Kazaz on 4/10/2025 in #help-and-questions
Prisma 6.6.0 ESM with Nx Monorepo - Typescript type check failures
The tsconfig.base.json has these rules (as part of many): erasableSyntaxOnly, exactOptionalPropertyTypes and noUnusedLocals The type check fails as it checks also the files in @prisma/client-application. Not sure why the heck this is happening as these files are in my node_modules folder. What I tried so far? 1. Adding an external entry of "external": ["@prisma/client-application/index.js"] tot he project.json file. 2. Adding to the exclude section of the tsconfig.app.json file:
"../../node_modules/@prisma/**/*",
"../../node_modules/@prisma/**/*",
3. Adding a new tsconfig.override.json with ts references from the tsconfig.app.json file that looks like this:
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"erasableSyntaxOnly": false,
"exactOptionalPropertyTypes": false,
"noUnusedLocals": false
},
"include": ["../../node_modules/@prisma/**/*"],
"exclude": []
}
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"erasableSyntaxOnly": false,
"exactOptionalPropertyTypes": false,
"noUnusedLocals": false
},
"include": ["../../node_modules/@prisma/**/*"],
"exclude": []
}
And the reference int he app config:
"references": [
{
"path": "./tsconfig.override.json"
}
]
"references": [
{
"path": "./tsconfig.override.json"
}
]
but seems like esbuild does not respect any of references, or maybe I'm doing something wrong. How can I overcome this WITHOUT turning off type check in development mode (using skipTypeCheck: true)??
22 replies
PPrisma
Created by Kazaz on 4/10/2025 in #help-and-questions
Prisma 6.6.0 ESM with Nx Monorepo - Typescript type check failures
As you can see in project.json file in the build target in development we also have type check and it uses the tsconfig.app.json file. Here is the tsconfig.app.json:
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"rootDir": "src",
"outDir": "../../dist/apps/jobs-service",
"types": ["node"],
"tsBuildInfoFile": "../../dist/apps/jobs-service/tsconfig.lib.tsbuildinfo"
},
"include": ["src/**/*.ts"],
"exclude": [
"vite.config.ts",
"vite.config.mts",
"vitest.config.ts",
"vitest.config.mts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
"src/**/*.spec.tsx",
"src/**/*.test.js",
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx",
"src/**/*.mock.ts"
],
"references": [
{
"path": "../../packages/environments/tsconfig.lib.json"
},
{
"path": "../../packages/utils/tsconfig.lib.json"
},
{
"path": "./tsconfig.override.json"
}
]
}
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"rootDir": "src",
"outDir": "../../dist/apps/jobs-service",
"types": ["node"],
"tsBuildInfoFile": "../../dist/apps/jobs-service/tsconfig.lib.tsbuildinfo"
},
"include": ["src/**/*.ts"],
"exclude": [
"vite.config.ts",
"vite.config.mts",
"vitest.config.ts",
"vitest.config.mts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
"src/**/*.spec.tsx",
"src/**/*.test.js",
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx",
"src/**/*.mock.ts"
],
"references": [
{
"path": "../../packages/environments/tsconfig.lib.json"
},
{
"path": "../../packages/utils/tsconfig.lib.json"
},
{
"path": "./tsconfig.override.json"
}
]
}
22 replies
PPrisma
Created by Kazaz on 4/10/2025 in #help-and-questions
Prisma 6.6.0 ESM with Nx Monorepo - Typescript type check failures
NX project.json and tsconfig settings In a specific file we have this import: import {PrismaClient} from '@prisma/client-application' Here is our project.json which uses esbuild to build our project:
{
"name": "jobs-service",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"tags": ["scope:jobs"],
"targets": {
"build": {
"executor": "@nx/esbuild:esbuild",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "development",
"options": {
"platform": "node",
"outputPath": "dist/apps/jobs-service",
"main": "src/main.ts",
"format": ["esm"],
"tsConfig": "{projectRoot}/tsconfig.app.json",
"deleteOutputPath": true,
"bundle": true,
"generatePackageJson": true,
"minify": false,
"outputHashing": "none",
"thirdParty": false
},
"configurations": {
"development": {
"sourcemap": true,
"declaration": true,
"skipTypeCheck": false
},
"production": {
"sourcemap": false,
"declaration": false,
"skipTypeCheck": true
}
},
"dependsOn": [
{
"projects": ["prisma-schemas"],
"target": "generate:application"
}
]
},
"serve": {
"executor": "@nx/js:node",
"defaultConfiguration": "development",
"options": {
"buildTarget": "jobs-service:build:development",
"runBuildTargetDependencies": true,
"watch": true,
"debounce": 100,
"inspect": true,
"port": 9229,
"host": "localhost"
},
"configurations": {
"production": {
"buildTarget": "jobs-service:build:production"
}
}
}
}
}
{
"name": "jobs-service",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"tags": ["scope:jobs"],
"targets": {
"build": {
"executor": "@nx/esbuild:esbuild",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "development",
"options": {
"platform": "node",
"outputPath": "dist/apps/jobs-service",
"main": "src/main.ts",
"format": ["esm"],
"tsConfig": "{projectRoot}/tsconfig.app.json",
"deleteOutputPath": true,
"bundle": true,
"generatePackageJson": true,
"minify": false,
"outputHashing": "none",
"thirdParty": false
},
"configurations": {
"development": {
"sourcemap": true,
"declaration": true,
"skipTypeCheck": false
},
"production": {
"sourcemap": false,
"declaration": false,
"skipTypeCheck": true
}
},
"dependsOn": [
{
"projects": ["prisma-schemas"],
"target": "generate:application"
}
]
},
"serve": {
"executor": "@nx/js:node",
"defaultConfiguration": "development",
"options": {
"buildTarget": "jobs-service:build:development",
"runBuildTargetDependencies": true,
"watch": true,
"debounce": 100,
"inspect": true,
"port": 9229,
"host": "localhost"
},
"configurations": {
"production": {
"buildTarget": "jobs-service:build:production"
}
}
}
}
}
22 replies
PPrisma
Created by Kazaz on 2/12/2025 in #help-and-questions
queryRaw plsql function failed Code: `42601`. Message: `ERROR: syntax error at or near "$1"`
Event this fails with the same issue:
await prismaClient.$queryRawUnsafe(
`SELECT main.create_brand_global_search_mv('123-dsds-dsds')`
);
await prismaClient.$queryRawUnsafe(
`SELECT main.create_brand_global_search_mv('123-dsds-dsds')`
);
And this with castings:
await prismaClient.$queryRawUnsafe(
`SELECT main.create_brand_global_search_mv('123-dsds-dsds'::text) as mv_name`
);
await prismaClient.$queryRawUnsafe(
`SELECT main.create_brand_global_search_mv('123-dsds-dsds'::text) as mv_name`
);
5 replies
PPrisma
Created by Kazaz on 2/12/2025 in #help-and-questions
queryRaw plsql function failed Code: `42601`. Message: `ERROR: syntax error at or near "$1"`
I also tried everything mentioned here by the AI: https://discord.com/channels/937751382725886062/1339147283022876673/1339147286353281034 Tried it all before it suggested it. Still getting the same issue :/
5 replies
PPrisma
Created by daniel on 9/2/2024 in #help-and-questions
Connection Pool Timeout Issue Despite Custom Limit
@Nurul (Prisma) Let's continue the chat here instead: https://discord.com/channels/937751382725886062/1280433844314574870/1280855789703135262 @daniel please also follow the conversation there (me and Daniel know each other, so it's cool)
8 replies
PPrisma
Created by daniel on 9/2/2024 in #help-and-questions
Connection Pool Timeout Issue Despite Custom Limit
Thanks @Nurul ! We'll give it a try and report
8 replies
PPrisma
Created by daniel on 9/2/2024 in #help-and-questions
Connection Pool Timeout Issue Despite Custom Limit
I'm actually having the same issue! Can someone help me understand it? More info I can share: 1. The DB can handle the connections. I have about 200+ connections on RDS that can handle about 900 connections. 2. I have 2 vCPU on my machine, but I've set the connection pool to 70. From what I can see the default behavior is num of cores * 2 + 1 - why is that? I saw that the query engine is not opening multiple threads, so why is there even a connection between the cores and the connections? 3. There are no long running queries. Checked that. Could number 2 be the reason I'm seeing the timeout error? The fact the query engine can't handle so many connections in the pool for such low end machine with only 2 vCPU?
8 replies