Skip to content

ci: run nuxt prepare as its own turbo task - #2629

Merged
Maciek Kucmus (mkucmus) merged 7 commits into
mainfrom
ci/turbo-nuxt-prepare
Aug 17, 2026
Merged

ci: run nuxt prepare as its own turbo task#2629
Maciek Kucmus (mkucmus) merged 7 commits into
mainfrom
ci/turbo-nuxt-prepare

Conversation

@mkucmus

@mkucmus Maciek Kucmus (mkucmus) commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Description

templates/vue-starter-template/tsconfig.json uses the Nuxt 4 layout from #2606: files: [] plus references into ./.nuxt. Vite loads the nearest tsconfig.json when it transforms a .vue file, so anything compiling this template needs .nuxt first. lumora-demo-store extends it, so it compiles those files too.

.nuxt is created by nuxt prepare, which only lives inside the template's build script. A turbo cache hit does not run the script. It restores the files listed in outputs and replays the logs. .nuxt is not in outputs, so it is neither generated nor restored:

[TSCONFIG_ERROR] Failed to load tsconfig '../vue-starter-template/.nuxt/tsconfig.app.json': Tsconfig not found

This PR moves nuxt prepare into its own uncacheable turbo task, so it always runs.

When it fails

Three things have to line up:

  • The machine has no .nuxt on disk. It is gitignored, so every fresh checkout starts this way.
  • vue-starter-template#build is a cache hit, so nuxt prepare is skipped.
  • lumora-demo-store is a cache miss, so it still has to compile the template's .vue files.

The third point is why this is not a corner case. A change touching only the extended template splits the hashes:

lumora-demo-store            cache=MISS
vue-starter-template         cache=HIT

When both hit or both miss, nothing breaks. Hence the intermittency. Remote caching is on in every workflow, so the hit can come from another machine.

Changes

  • vue-starter-template gets a nuxt-prepare script.
  • turbo.json gets a nuxt-prepare task with cache: false, so it always runs.
  • build and generate depend on nuxt-prepare and ^nuxt-prepare, covering both the template being built and the one being extended.
  • typecheck depends on ^nuxt-prepare.

No package names are hardcoded. Turbo skips the task where the script is not defined. Only vue-starter-template needs it today: it is the one package that is both extended by another and uses references into its own .nuxt.

Why not cache .nuxt

Listing .nuxt/** as a build output also hides the error, and was the first attempt on the #2609 branch. It is the wrong tool:

  • .nuxt is a nuxt prepare artifact, not a build output.
  • 5 of its 47 files contain absolute paths (shopware.d.ts, uno.config.mjs, app.config.mjs, types/layouts.d.ts, types/nitro-imports.d.ts), and remote cache would carry one machine's paths onto another.

That workaround has since been reverted, so neither fix is on main today. Thanks Patryk Tomczyk (@patzick) for catching it in review.

Type of change

Bug fix (non-breaking change which fixes an issue)

ToDo's

  • Changeset file provided (not needed, only private packages and root config change)
  • Documentation added/updated (not needed)

Additional context

Reproduced against current main config:

  1. turbo run build --filter=vue-starter-template to populate the cache.
  2. rm -rf templates/vue-starter-template/.nuxt.
  3. Re-run the build: 6 cached, 6 total in 46ms, >>> FULL TURBO, and .nuxt is not recreated.
  4. turbo run typecheck --filter=lumora-demo-store fails with the error above.

After the fix, both paths are covered and caching is preserved (7 of 8 tasks still cached in 1.9s, only nuxt-prepare bypassing). A repo-wide run on the #2609 branch was clean: pnpm build 35/35, pnpm typecheck 69/69, pnpm lint 31/31.

Not related to #2632. That was a client bundle resolve error for @oxc-parser/binding-wasm32-wasi. This is a tsconfig lookup during transform.

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontends-starter-template-extended Ready Ready Preview Aug 17, 2026 11:36am
frontends-vue-starter-template Ready Ready Preview Aug 17, 2026 11:36am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses intermittent CI/typecheck failures in the Nuxt template inheritance chain by ensuring .nuxt is generated even when Turbo returns cached build outputs, preventing missing ../vue-starter-template/.nuxt/tsconfig.app.json lookups during .vue transforms.

Changes:

  • Adds a dedicated nuxt-prepare Turbo task with cache: false so nuxt prepare always executes.
  • Wires build, generate, and typecheck to depend on nuxt-prepare (local and dependency scopes via ^nuxt-prepare).
  • Adds a nuxt-prepare npm script to templates/vue-starter-template to enable the Turbo task.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
turbo.json Introduces an uncacheable nuxt-prepare task and adds it as a dependency for build/generate/typecheck/dev flows.
templates/vue-starter-template/package.json Adds a nuxt-prepare script so Turbo can invoke nuxt prepare as a standalone task.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread templates/vue-starter-template/package.json

@patzick Patryk Tomczyk (patzick) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — diagnosis and fix match: cache: false is the only way to make nuxt prepare survive a build cache hit, and keeping .nuxt out of outputs is right given the absolute paths in it. CI is green on all required checks.

Two non-blocking notes inline (redundant ^nuxt-prepare entries, and dev now pulling a full ^build).

Comment thread turbo.json Outdated
Comment thread turbo.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants