Local Runnable Project Structure
The error occurs due to missing monorepo configuration and Cloudflare type. I will modify it to a structure that can be executed locally.
Project Structure (Executable)
Section titled “Project Structure (Executable)”newsfork-seeds/├── package.json├── tsconfig.json├── wrangler.jsonc├── .dev.vars # Cloudflare Workers 로컬 환경변수├── src/│ ├── index.ts # Hono API│ ├── routes/ # HTTP 엔드포인트│ ├── domain/ # 순수 비즈니스 로직│ ├── infra/ # Cloudflare 어댑터│ ├── lib/ # 유틸리티│ └── schemas/ # Zod 스키마├── scripts/├── migrations/└── data/Key Configuration Files
Section titled “Key Configuration Files”- package.json:
pnpm dev,pnpm deploy,validate:localetc. scripts - wrangler.jsonc: D1, R2, KV, Queues bindings
- .dev.vars: Local environment variables (excluding Git)
Execution Order
Section titled “Execution Order”# 1. 의존성 설치pnpm install
# 2. 로컬 서버 시작pnpm dev
# 3. 검증 (별도 터미널)pnpm validate:localTroubleshooting ### “Cannot find module ‘@repo/db/schema’” - Monorepo-specific path. Modify to import { ... } from '../db/schema' format. ### “Cannot find name ‘R2Bucket’”
Section titled “Troubleshooting ### “Cannot find module ‘@repo/db/schema’” - Monorepo-specific path. Modify to import { ... } from '../db/schema' format. ### “Cannot find name ‘R2Bucket’””- Install
@cloudflare/workers-typesand add totypesintsconfig.json.
D1 Migration Failed
Section titled “D1 Migration Failed”rm -rf .wrangler/state/v3/d1wrangler d1 create <db-name> --localpnpm db:migrateRelated Documents
Section titled “Related Documents”- Environment Setup — Environment Setup Details
- Local Testing — Local Testing Procedure
- Deployment — Deployment Guide