Skip to content

can't turbo build tanstack start with prerender enabled #11412

@ananaBMaster

Description

@ananaBMaster

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://github.com/ananaBMaster/monorepo-tanstarter

Which canary version will you have in your reproduction?

turbo 2.7.4-canary.1

Environment information

> turbo info
• turbo 2.7.4-canary.1
CLI:
   Version: 2.7.4-canary.1
   Path to executable: /Users/leonz/Github/monorepo-tanstarter/node_modules/.pnpm/turbo-darwin-arm64@2.7.4-canary.1/node_modules/turbo-darwin-arm64/bin/turbo
   Daemon status: Running
   Package manager: pnpm9

Platform:
   Architecture: aarch64
   Operating system: macos
   WSL: false
   Available memory (MB): 4466
   Available CPU cores: 14

Environment:
   CI: None
   Terminal (TERM): xterm-256color
   Terminal program (TERM_PROGRAM): vscode
   Terminal program version (TERM_PROGRAM_VERSION): 2.0.34
   Shell (SHELL): /bin/zsh
   stdin: false

Expected behavior

run pnpm build should build. now only works with env CI=true

Actual behavior

with

    tanstackStart({
      prerender: {
        enabled: true,
      },
    }),
  1. If don't use turbo, run cd apps/web && pnpm build, works
  2. If use turbo
    i) in the root dir, run CI=true pnpm build --force, works
    ii) in the root dir, run pnpm build --force, has the error

The error is

 ~/Github/monorepo-tanstarter  main ................................ base py  system node  16:57:05 
> pnpm build --force

> monorepo-tanstarter@ build /Users/leonz/Github/monorepo-tanstarter
> turbo run build --force

• turbo 2.7.3
• Packages in scope: @read-frog/web
• Running build in 1 packages
• Remote caching disabled
┌─ @read-frog/web#build > cache bypass, force executing 7eb28853d3068e90 


> @read-frog/web@0.0.0 build /Users/leonz/Github/monorepo-tanstarter/apps/we
b
> vite build && tsc --noEmit

...
✓ built in 532ms
[prerender] Prerendering pages...
[prerender] Concurrency: 14
[prerender] Crawling: /
[prerender] Prerendered 0 pages:
file:///Users/leonz/Github/monorepo-tanstarter/node_modules/.pnpm/@tanstack+
start-plugin-core@1.145.3_@tanstack+react-router@1.144.0_react-dom@19.2.3_re
a_a885d342423b94b4b456f798ea19fe84/node_modules/@tanstack/start-plugin-core/
dist/esm/prerender.js:126
            throw new Error(`Failed to fetch ${page.path}: ${res.statusText}
`, {
                  ^

Error: Failed to fetch /: Internal Server Error
    at file:///Users/leonz/Github/monorepo-tanstarter/node_modules/.pnpm/@ta
nstack+start-plugin-core@1.145.3_@tanstack+react-router@1.144.0_react-dom@19
.2.3_rea_a885d342423b94b4b456f798ea19fe84/node_modules/@tanstack/start-plugi
n-core/dist/esm/prerender.js:126:19
    at process.processTicksAndRejections (node:internal/process/task_queues:
103:5)
    at async file:///Users/leonz/Github/monorepo-tanstarter/node_modules/.pn
pm/@tanstack+start-plugin-core@1.145.3_@tanstack+react-router@1.144.0_react-
dom@19.2.3_rea_a885d342423b94b4b456f798ea19fe84/node_modules/@tanstack/start
-plugin-core/dist/esm/queue.js:38:17 {
  [cause]: Response {}
}

Node.js v24.12.0
 ELIFECYCLE  Command failed with exit code 1.
command finished with error: command (/Users/leonz/Github/monorepo-tanstarte
r/apps/web) /Users/leonz/Library/pnpm/.tools/pnpm/10.27.0/bin/pnpm run build
 exited (1)
└─ @read-frog/web#build ──
@read-frog/web#build: command (/Users/leonz/Github/monorepo-tanstarter/apps/web) /Users/leonz/Library/pnpm/.tools/pnpm/10.27.0/bin/pnpm run build exited (1)

 Tasks:    0 successful, 1 total
Cached:    0 cached, 1 total
  Time:    2.96s 
Failed:    @read-frog/web#build

 ERROR  run failed: command  exited (1)
 ELIFECYCLE  Command failed with exit code 1.

To Reproduce

  1. clone https://github.com/ananaBMaster/monorepo-tanstarter
  2. pnpm i
  3. pnpm build --force

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions