Skip to content

oRPC + Cloudflare + Tanstack Start build error "cloudflare:workers" #685

@hiroingk

Description

@hiroingk

Issue

When I create a project combining oPRC and Tanstack Start and run bun run build, I get an error "Module not found, treating it as an external dependency" from "cloudflare:workers". It seems that importing the auth package from the web is the cause.

Configuration

bun create better-t-stack@latest my-app --frontend tanstack-start native-nativewind --backend hono --runtime workers --api orpc --auth better-auth --payments none --database sqlite --orm drizzle --db-setup turso --package-manager bun --git --web-deploy none --server-deploy alchemy --install --addons oxlint turborepo --examples todo
{
  "$schema": "https://r2.better-t-stack.dev/schema.json",
  "version": "3.2.23",
  "createdAt": "2025-11-09T12:05:30.797Z",
  "database": "sqlite",
  "orm": "drizzle",
  "backend": "hono",
  "runtime": "workers",
  "frontend": [
    "tanstack-start",
    "native-nativewind"
  ],
  "addons": [
    "oxlint",
    "turborepo"
  ],
  "examples": [
    "todo"
  ],
  "auth": "better-auth",
  "packageManager": "bun",
  "dbSetup": "turso",
  "api": "orpc",
  "webDeploy": "none",
  "serverDeploy": "alchemy"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions