Conversation
There was a problem hiding this comment.
🔧 Build Fix:
The exports field in @repo/constants package.json only specifies the JavaScript file but missing the TypeScript declaration file path, causing TypeScript module resolution to fail when importing the package.
View Details
📝 Patch Details
diff --git a/starter/turborepo-with-hono/packages/constants/package.json b/starter/turborepo-with-hono/packages/constants/package.json
index 5e12fb9f..786af730 100644
--- a/starter/turborepo-with-hono/packages/constants/package.json
+++ b/starter/turborepo-with-hono/packages/constants/package.json
@@ -1,7 +1,10 @@
{
"name": "@repo/constants",
"exports": {
- ".": "./dist/constants.js"
+ ".": {
+ "types": "./dist/constants.d.ts",
+ "default": "./dist/constants.js"
+ }
},
"scripts": {
"build": "tsc"
Analysis
TypeScript compilation failure due to missing type declarations
What fails: TypeScript compiler fails on starter/turborepo-with-hono/apps/api/src/index.ts at line 2, column 26 when importing @repo/constants
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 @repo/constants package exports only the JavaScript file in package.json but doesn't specify the TypeScript declaration file, causing TypeScript module resolution to fail even when the package is built.
There was a problem hiding this comment.
🔧 Build Fix:
The @repo/constants package exports ./dist/constants.js but has no index.ts entry point, causing TypeScript to fail when trying to resolve the module import in the API application.
View Details
📝 Patch Details
diff --git a/starter/turborepo-with-hono/packages/constants/package.json b/starter/turborepo-with-hono/packages/constants/package.json
index 5e12fb9f..6af820b5 100644
--- a/starter/turborepo-with-hono/packages/constants/package.json
+++ b/starter/turborepo-with-hono/packages/constants/package.json
@@ -1,7 +1,7 @@
{
"name": "@repo/constants",
"exports": {
- ".": "./dist/constants.js"
+ ".": "./dist/index.js"
},
"scripts": {
"build": "tsc"
diff --git a/starter/turborepo-with-hono/packages/constants/src/index.ts b/starter/turborepo-with-hono/packages/constants/src/index.ts
new file mode 100644
index 00000000..363c822d
--- /dev/null
+++ b/starter/turborepo-with-hono/packages/constants/src/index.ts
@@ -0,0 +1 @@
+export * from './constants'
\ No newline at end of file
Analysis
TypeScript compilation fails due to missing package entry point
What fails: TypeScript compiler fails on starter/turborepo-with-hono/apps/api/src/index.ts when importing from @repo/constants monorepo package
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 @repo/constants package exports ./dist/constants.js but the package structure lacks a proper index.ts entry point that gets compiled to the expected location.
Updated README.md to include deployment instructions and prerequisites for using Elysia with Bun runtime.
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.