Conversation
There was a problem hiding this comment.
🔧 Build Fix:
The API app in the Turbo monorepo is missing build and check-types scripts, preventing TypeScript compilation and causing the @repo/constants import to fail during builds.
View Details
📝 Patch Details
diff --git a/starter/turborepo-with-hono/apps/api/package.json b/starter/turborepo-with-hono/apps/api/package.json
index 4b7f3ce4..7d5f6a90 100644
--- a/starter/turborepo-with-hono/apps/api/package.json
+++ b/starter/turborepo-with-hono/apps/api/package.json
@@ -2,6 +2,8 @@
"name": "api",
"type": "module",
"scripts": {
+ "build": "tsc",
+ "check-types": "tsc --noEmit",
"dev": "srvx"
},
"dependencies": {
diff --git a/starter/turborepo-with-hono/turbo.json b/starter/turborepo-with-hono/turbo.json
index a274843e..5ccd2d39 100644
--- a/starter/turborepo-with-hono/turbo.json
+++ b/starter/turborepo-with-hono/turbo.json
@@ -12,7 +12,7 @@
"dependsOn": ["^lint"]
},
"check-types": {
- "dependsOn": ["^check-types"]
+ "dependsOn": ["^check-types", "^build"]
},
"dev": {
"cache": false,
Analysis
Missing build script causes TypeScript compilation failure in Turbo monorepo
What fails: TypeScript compiler fails on starter/turborepo-with-hono/apps/api/src/index.ts due to missing @repo/constants module
How to reproduce:
cd starter/turborepo-with-hono
rm -rf packages/constants/dist
pnpm install
npx tsc --project apps/api/tsconfig.json --noEmitResult:
apps/api/src/index.ts(2,26): error TS2307: Cannot find module '@repo/constants' or its corresponding type declarations.
Root cause: The API app was missing build and check-types scripts, preventing it from being included in the Turbo build pipeline. Additionally, the check-types task didn't depend on ^build, so dependencies weren't built before type checking.
There was a problem hiding this comment.
🔧 Build Fix:
The API app was missing a build script in its package.json, causing TypeScript compilation to fail when trying to import @repo/constants because the monorepo build system couldn't properly build dependencies.
View Details
📝 Patch Details
diff --git a/starter/turborepo-with-hono/apps/api/package.json b/starter/turborepo-with-hono/apps/api/package.json
index 4b7f3ce4..7695ed4f 100644
--- a/starter/turborepo-with-hono/apps/api/package.json
+++ b/starter/turborepo-with-hono/apps/api/package.json
@@ -2,6 +2,7 @@
"name": "api",
"type": "module",
"scripts": {
+ "build": "tsc",
"dev": "srvx"
},
"dependencies": {
Analysis
Missing build script causes TypeScript compilation failure in Turborepo
What fails: TypeScript compilation fails in starter/turborepo-with-hono/apps/api/src/index.ts because the API app lacks a build script, preventing proper dependency resolution in the monorepo
How to reproduce:
cd starter/turborepo-with-hono/apps/api && npx tsc --noEmitResult:
src/index.ts(2,26): error TS2307: Cannot find module '@repo/constants' or its corresponding type declarations.Root cause: The api package was missing a build script in its package.json, so turbo run build never built it as part of the monorepo build process. This left the @repo/constants dependency unresolved during direct TypeScript compilation.
No description provided.