这是indexloc提供的服务,不要输入任何密码
Skip to content

Cache is extracted to wrong destination #8476

@markbrockhoff

Description

@markbrockhoff

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/markbrockhoff/turbo-repo-bug-repro

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Mac

Which canary version will you have in your reproduction?

2.0.4-canary.3

Describe the Bug

Whenever I execute a build using turborepo for the first time everything is generated correctly and cached. But when running the same build again the existing cache is restored to the wrong directory causing build files to end up in the src directory.

Expected Behavior

I'd expect turborepo to restore the build cache in the exact same location where it came from.

To Reproduce

I created a minimal reproduction using the latest version of turborepo containing only one package which is the default starter for creating a Nuxt module (That's where I encountered the issue)

To reproduce the issue do the following steps:

  1. Clone the repro: git clone https://github.com/markbrockhoff/turbo-repo-bug-repro
  2. Install the dependencies pnpm i
  3. Run a first build: pnpm build
  4. Run a second build: pnpm build

After the second build you'll see that two new files were created within /packages/nuxt-test/src/runtime. These files should be placed inside the dist folder but somehow seem to be restored into the src folder.
I think the issue has something to do with the fact that the build task depends on the dev:prepare task and both habe the dist folder as output, however it's still very strange to me that the files end up in a totally different place.

Additional context

I'm using pnpm v9.3.0 and node 20.11.0, any help with this issue would be appreciated. Thanks

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