Turborepo cache miss on consecutive builds when .next folder exists, even with identical hash
#11212
Unanswered
PSriVignesH
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
The Strange Part
Same hash, different results:
After deleting
.next:Immediate next build:
Hash
1a6444a677c8bb2cis identical both times! 🤔My Configuration
turbo.json
{ "$schema": "https://turbo.build/schema.json", "ui": "tui", "tasks": { "//#biome-lint": { "inputs": [ "apps/**/*.{ts,tsx,js,jsx}", "packages/**/*.{ts,tsx,js,jsx}", "biome.json", "packages/biome-config/biome.json" ], "outputs": [] }, "//#biome-format": { "cache": false, "outputs": [] }, "//#biome-check": { "cache": false, "outputs": [] }, "type-check": { "dependsOn": ["^type-check"], "inputs": ["**/*.ts", "**/*.tsx", "tsconfig.json", "tsconfig.*.json"], "outputs": [] }, "build": { "dependsOn": ["^build"], "inputs": [ "$TURBO_DEFAULT$", "!Dockerfile*", "!*.dockerfile", "!.dockerignore", "!.next/**" ], "outputs": [ ".next/**", "!.next/cache/**", "!.next/trace/**", "!.next/analyze/**", "!.next/*.log", "!.next/BUILD_ID", "!.next/standalone/**/.env*", "!.next/standalone/**/node_modules/.cache/**" ] }, "dev": { "cache": false, "persistent": true } } }next.config.ts (same for both apps)
Project Structure
What I’ve Tried
!.next/**to inputs.next/cache/**from outputs.nextsubfolders.nextbefore buildCurrent Workaround
{ "scripts": { "build": "rimraf apps/*/.next && turbo run build" } }This works but defeats the purpose of caching.
Questions
output: 'standalone'config affecting cache behavior?outputFileTracingRootinterfering with Turborepo caching?.nextevery time?Impact
Thanks for any help! 🙏
turborepo-remote-cache/
├── apps/
│ ├── web/ # Next.js 16.0.1
│ │ ├── next.config.ts
│ │ └── app/page.tsx
│ └── docs/ # Next.js 16.0.1
│ ├── next.config.ts
│ └── app/page.tsx
├── packages/
│ └── ui/ # Shared components
├── turbo.json
├── package.json
└── pnpm-workspace.yaml
turbo.json build task:
{ "build": { "dependsOn": ["^build"], "inputs": ["$TURBO_DEFAULT$", "!.next/**"], "outputs": [".next/**", "!.next/cache/**"] } }Remote Cache Settings
npx turbo loginnpx turbo linkAdditional information
No response
Example
https://github.com/PSriVignesH/turborepo-remote-cache
Beta Was this translation helpful? Give feedback.
All reactions