From 9e92fdd820cfe4e2e39576f26a7d7c476df88a56 Mon Sep 17 00:00:00 2001 From: Julien Gautier Date: Tue, 26 May 2026 14:50:04 +0200 Subject: [PATCH] fix(seed): use tsconfig.app.json instead of inline --compiler-options The inline --compiler-options '{"module":"CommonJS",...}' was being unquoted by the shell when pnpm run db:seed re-spawned ts-node: > ts-node --compiler-options {module:CommonJS,esModuleInterop:true,...} SyntaxError: Expected property name or '}' in JSON at position 1 Cross-platform quoting of JSON-on-cmdline is a notorious pain. apps/portal-bff/tsconfig.app.json already declares all the options we need (module=commonjs, esModuleInterop=true, target=es2021, moduleResolution=node, types=[node]). Point ts-node at it with -P and drop the inline JSON entirely. ts-node --transpile-only ignores the tsconfig's `include`/`exclude` fields for the file passed explicitly, so the fact that seed.ts is under prisma/ (not src/) doesn't matter. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8abd5ae..42c1c0c 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "docs:dev": "vitepress dev docs", "docs:build": "vitepress build docs", "docs:preview": "vitepress preview docs", - "db:seed": "ts-node --transpile-only --compiler-options {\"module\":\"CommonJS\",\"esModuleInterop\":true,\"target\":\"ES2020\"} apps/portal-bff/prisma/seed.ts" + "db:seed": "ts-node --transpile-only -P apps/portal-bff/tsconfig.app.json apps/portal-bff/prisma/seed.ts" }, "private": true, "lint-staged": { -- 2.30.2