Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turbo@1.0.25 doesn't detect any packages #549

Closed
PavlMais opened this issue Jan 12, 2022 · 37 comments · Fixed by #569
Closed

turbo@1.0.25 doesn't detect any packages #549

PavlMais opened this issue Jan 12, 2022 · 37 comments · Fixed by #569

Comments

@PavlMais
Copy link

PavlMais commented Jan 12, 2022

What version of Turborepo are you using?

1.0.25

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

pnpm

What operating system are you using?

Linux

Describe the Bug

After updating to 1.0.25 turbo doesn't detect any packages

> test@1.0.0 build /home/paul/r/test
> turbo run build

• Packages in scope: 
• Running build in 0 packages

 Tasks:    0 successful, 0 total
Cached:    0 cached, 0 total
  Time:    2ms >>> FULL TURBO 

Expected Behavior

in 1.0.24 everything works fine

> test@1.0.0 build /home/paul/r/test
> turbo run build

• Packages in scope: @test/api, @test/shared, test-server, test-ui
• Running build in 4 packages
@test/shared:build: cache miss, executing 3ecd2717612f3d54
@test/shared:build: 
...

To Reproduce

update to 1.0.25 and run any script e.g dev, build

@jaredpalmer
Copy link
Contributor

Does this problem happen in 1.0.26?

@wab
Copy link

wab commented Jan 13, 2022

Yes it is

• Packages in scope:
• Running build in 0 packages

 Tasks:    0 successful, 0 total
Cached:    0 cached, 0 total
  Time:    13ms >>> FULL TURBO

❯ turbo --version
1.0.26

@samburgers
Copy link

Same here. Steps to replicate:

npx create-turbo@latest
? Where would you like to create your turborepo? .
? Which package manager do you want to use? npm

Delete folder apps/docs

npm run dev

> turborepo-basic-shared@0.0.0 dev
> turbo run dev --parallel

• Packages in scope: 
• Running dev in 0 packages

 Tasks:    0 successful, 0 total
Cached:    0 cached, 0 total
  Time:    9ms >>> FULL TURBO

@jaredpalmer
Copy link
Contributor

Investigating

@shunkakinoki
Copy link

Same here. Some packages are missing, vercel builds failing

@jaredpalmer
Copy link
Contributor

Can you upgrade to .27?

@shunkakinoki
Copy link

Thank you for the response!

Did that, resolved to multiple versions, but not working

@shunkakinoki
Copy link

apps/home is detecteded while
apps/app and apps/og is not

@jaredpalmer
Copy link
Contributor

jaredpalmer commented Jan 14, 2022

Can you set an env var with ENABLE_ROOT_PATH_BUILD_CACHE to 1 on Vercel?

@PavlMais
Copy link
Author

PavlMais commented Jan 14, 2022

Same problem with 1.0.27 and 1.0.28

@shunkakinoki
Copy link

Doesn't help ... the detected packages completely differ depending on ci envs or local

@rix1
Copy link

rix1 commented Jan 14, 2022

I experienced this on a brand new repo (after running ❯ npx create-turbo@latest) as well.

The initial run works great, but if I rename a directory Turbo doesn't seem to be able to resolve any packages... Not sure if it helps, but at least here's a way to reproduce:

  1. ❯ npx create-turbo@latest (selecting pnpm)
  2. ❯ pnpm dev (works)
  3. ❯ mv packages/ui/ packages/ui-new (rename package)
  4. ❯ pnpm dev (doesn't work)
  5. ❯ mv packages/ui-new/ packages/ui (revert)
  6. ❯ pnpm dev (works again)
Screenshot of terminal output Screenshot by Rix1 2022-01-14 at 23 10 37

@mm-webx
Copy link

mm-webx commented Jan 14, 2022

Same for my side, node 16.13.1, created by npx use "./" as target and detect 0 packages:

.../.nvm/versions/node/v16.13.1/lib/node_modules/npm/bin/npm-cli.js run build --scripts-prepend-node-path=auto

> turborepo-basic-shared@0.0.0 build
> turbo run build

• Packages in scope: 
• Running build in 0 packages

 Tasks:    0 successful, 0 total
Cached:    0 cached, 0 total
  Time:    9ms >>> FULL TURBO


Process finished with exit code 0```

@mm-webx
Copy link

mm-webx commented Jan 14, 2022

I change version to 1.0.25 and run "yarn", then run "build", then update again to "latest" and delete all ".turbo" folders, now "build" working fine.

@davidboom95
Copy link

davidboom95 commented Jan 14, 2022

Same problem for me. I tried some of the solutions here without success.

@shunkakinoki
Copy link

How does the package detection work at the moment? not from yarn workspaces?

@miestasniyo
Copy link

v1.0.28

yarn create turbo
cd my-app
yarn dev # works > Packages in scope: config, docs, tsconfig, ui, web
rm -rf apps/docs
yarn dev # doesn't work > Packages in scope: 

@cdaringe
Copy link

Looking through the 24->25 diff, I don't see anything obvious. There is some pnpm specific logic changes, but those seem around dlx for installation, which is not correlated with this failure mode.

Confirmed, downgrade to 24 restores expected behavior.

@jaredpalmer
Copy link
Contributor

If you move or rename a package, re-running pnpm install works. I wonder if this is something to do with: 8c871d4

@jaredpalmer
Copy link
Contributor

Can confirm this issue is with 8c871d4

@betaorbust
Copy link

Just a few more datapoints:

In my monorepo (yarn), I have

    "workspaces": [
        "packages/*",
        "apps/*"
    ],

and only the items in /packages are found.

Things I've tried that didn't work:

  • Removing the "packages/*": 0 packages found
  • Moving package from /apps to /packages: moved package now detected as part of /packages, no /apps found.
  • Moving a building package in /packages to /apps: all /packages found, no /apps found (and not the one I moved there.)
  • Messing around with scope

Things that did work:

  • Downgrading to 1.0.24

@JonasHiltl
Copy link

I'm still experiencing this with v1.0.28 on WSL.
After renaming the directory & package name inside a workspace the whole workspace doesn't get recognized anymore.

@shunkakinoki
Copy link

I solved it by removing symlinks altogether.
Probably some symlinks were broken, leading to turborepo not recognizing it.
Hope this helps!

@JonasHiltl
Copy link

@shunkakinoki yea I ended up doing the same

@anton-artemyev
Copy link

i'm still seeing this issue after upgrading to 1.0.28, @shunkakinoki how did you fix it? not sure what you mean by removing symlinks

@shunkakinoki
Copy link

find -type l -delete and remove symlinks, and then figure out what symlinks breaks turborepo

@shikelong
Copy link

same issue in 1.0.28

@shikelong
Copy link

same issue in 1.0.28

I fix this issue by run clean step, and then reinstall root level dependencies.

pnpm run clean

pnpm install

pnpm run dev
# now it's ok

My clean script: "clean": "turbo run clean && rm -rf node_modules"

@JonasHiltl
Copy link

@shikelong what is the clean script inside the packages/apps?

@shikelong
Copy link

"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"

@shikelong
Copy link

At first, I use pnpm as packageManager. And I install dependencies in isolate mode.
In this mode, turbo can detect packages.
But Storybook can work in isolate mode, So I change node-linker config to hoisted. But in this mode, turbo cannot detect packages even I run clean script.
So, finally, I switch to yarn classical. It's all ok —— Storybook and turbo-repo apps detecting.

@JonasHiltl
Copy link

The problem with your clean script is that turbo can't execute it in the missing packages, because the symlinks are broken so turbo has issues detecting the actual packages present in the workspaces.
For examples when having an apps and common workspace. Then a package inside the apps workspace got deleted, which broke some symlinks, the clean script off the packages inside apps will not get executed.
Running the clean script manually in every package also doesn't help

@bkiac
Copy link

bkiac commented Jan 26, 2022

I still get this issue with 1.0.28 when I create/move/delete packages, but cleaning up the node_modules and reinstalling from root fixes it.

@PavlMais
Copy link
Author

This issue was fixed in 1.1.0-canary.2

@BlackGlory
Copy link

BlackGlory commented Mar 8, 2022

I encountered this problem in 1.1.4 and 1.1.5.
When the current directory is a symbolic link, no package can be found, otherwise, it runs normally.

@xbtmatt
Copy link

xbtmatt commented May 18, 2024

I encountered this issue because I was linking my packages in pnpm-workspaces.yaml like so:

packages:
  - "api/*"
  - "frontend/*"

when I needed to do it as:

packages:
  - "api"
  - "frontend"

Because api and frontend were actually top-level packages, not a directory of packages.

@jeffng50
Copy link

Same with npm here @xbtmatt 's solution fixed it for me, the docs should mention it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet