GithubHelp home page GithubHelp logo

Comments (3)

chris-olszewski avatar chris-olszewski commented on September 17, 2024 1

@markbrockhoff Thanks for the report!

I think this is still a bug on our end as we should be removing the dist/runtime symlink and creating a new directory instead of just placing files in it.

Now having two tasks who disagree on what a file (dist/runtime) should be is to be avoided as running one task will effectively "undo" the other.

from turbo.

chris-olszewski avatar chris-olszewski commented on September 17, 2024

I can confirm that this is due to the overlapping outputs interacting in a very weird way. It appears that something in dev:prepare is creating a symlink from dist/runtime -> src/runtime:

[0 olszewski@chriss-mbp] /tmp/turbo-repo-bug-repro/packages/nuxt-test $ pnpm dev:prepare

> [email protected] dev:prepare /private/tmp/turbo-repo-bug-repro/packages/nuxt-test
> nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground

ℹ Stubbing my-module                                                                                                                         11:30:47 AM
ℹ Cleaning dist directory: ./dist                                                                                                            11:30:47 AM
✔ Types generated in .nuxt                                                                                                                   11:30:49 AM
✔ Types generated in playground/.nuxt                                                                                                        11:30:50 AM
[0 olszewski@chriss-mbp] /tmp/turbo-repo-bug-repro/packages/nuxt-test $ ls -lh dist 
total 48
-rw-r--r--  1 olszewski  wheel   227B Jun 13 11:30 module.cjs
-rw-r--r--  1 olszewski  wheel   171B Jun 13 11:30 module.d.ts
-rw-r--r--  1 olszewski  wheel   156B Jun 13 11:30 module.json
-rw-r--r--  1 olszewski  wheel   477B Jun 13 11:30 module.mjs
lrwxr-xr-x  1 olszewski  wheel    64B Jun 13 11:30 runtime -> /private/tmp/turbo-repo-bug-repro/packages/nuxt-test/src/runtime
-rw-r--r--  1 olszewski  wheel   918B Jun 13 11:30 types.d.mts
-rw-r--r--  1 olszewski  wheel   912B Jun 13 11:30 types.d.ts

This leads to the issue when we there's a cache hit for my-module#build and we attempt to restore dist/runtime/plugin.js and dist/runtime/plugin.d.ts to dist/runtime which now points to src/runtime due to the symlink created by dev:prepare

[0 olszewski@chriss-mbp] /tmp/turbo-repo-bug-repro $ tar --use-compress-program=unzstd -tvf .turbo/cache/72cffa046a69ae97.tar.zst 
-rw-r--r--  0 0      0        1257 Dec 31  1969 packages/nuxt-test/.turbo/turbo-build.log
drwxr-xr-x  0 0      0           0 Dec 31  1969 packages/nuxt-test/dist/
-rw-r--r--  0 0      0         227 Dec 31  1969 packages/nuxt-test/dist/module.cjs
-rw-r--r--  0 0      0         192 Dec 31  1969 packages/nuxt-test/dist/module.d.mts
-rw-r--r--  0 0      0         192 Dec 31  1969 packages/nuxt-test/dist/module.d.ts
-rw-r--r--  0 0      0         156 Dec 31  1969 packages/nuxt-test/dist/module.json
-rw-r--r--  0 0      0         415 Dec 31  1969 packages/nuxt-test/dist/module.mjs
drwxr-xr-x  0 0      0           0 Dec 31  1969 packages/nuxt-test/dist/runtime/
-rw-r--r--  0 0      0         152 Dec 31  1969 packages/nuxt-test/dist/runtime/plugin.d.ts
-rw-r--r--  0 0      0         141 Dec 31  1969 packages/nuxt-test/dist/runtime/plugin.js
drwxr-xr-x  0 0      0           0 Dec 31  1969 packages/nuxt-test/dist/runtime/server/
-rw-r--r--  0 0      0          56 Dec 31  1969 packages/nuxt-test/dist/runtime/server/tsconfig.json
-rw-r--r--  0 0      0         425 Dec 31  1969 packages/nuxt-test/dist/types.d.mts
-rw-r--r--  0 0      0         419 Dec 31  1969 packages/nuxt-test/dist/types.d.ts

from turbo.

markbrockhoff avatar markbrockhoff commented on September 17, 2024

Ah, that makes sense that the symlik is causing the issue. Thanks for the explanation.
I was able to fix the issue inside my project by avoiding the duplicate caching of the dist folder. However I still wanted to report the strange behavior as it might also affect other people.

from turbo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.