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

[turborepo] Configuring globalDependencies in a non-monorepo #4140

Closed
stefanofa opened this issue Mar 9, 2023 · 2 comments · Fixed by #4240
Closed

[turborepo] Configuring globalDependencies in a non-monorepo #4140

stefanofa opened this issue Mar 9, 2023 · 2 comments · Fixed by #4240
Assignees
Labels
kind: bug Something isn't working

Comments

@stefanofa
Copy link
Contributor

What version of Turborepo are you using?

1.8.3

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

Yarn v1

What operating system are you using?

Mac

Describe the Bug

I tried to add turborepo to an existing non-monorepo next project.
The turbo.json configuration is as follows:

{
  "$schema": "https://turbo.build/schema.json",
  "globalDependencies": ["**/.env.*local"],
  "pipeline": {
    "build": {
      "outputs": [".next/**"]
    },
    "lint": {},
    "dev": {
      "cache": false,
      "persistent": true
    }
  }
}

But when I run

yarn turbo build

I get the following error:

run failed: failed to collect global hash inputs: package.json: no workspaces found. Turborepo requires Yarn workspaces to be defined in the root package.json
Turbo error: failed to collect global hash inputs: package.json: no workspaces found. Turborepo requires Yarn workspaces to be defined in the root package.json
error Command failed with exit code 1.

If I remove

"globalDependencies": ["**/.env.*local"],

from the configuration, seems to work instead.

I tried to do the same with the official example of non-monorepo and the same error occurs.

Expected Behavior

Being able to use turborepo in a 'non-monorepo' by having the configuration option globalDependencies working.

To Reproduce

npx degit vercel/turbo/examples/non-monorepo non-monorepo
cd non-monorepo
yarn
git init . && git add . && git commit -m "Init"
  • Edit the file turbo.json by adding the option "globalDependencies": ["**/.env.*local"].

  • Run:

yarn turbo build

Reproduction Repo

No response

@stefanofa stefanofa added area: turborepo kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Mar 9, 2023
@arlyon
Copy link
Contributor

arlyon commented Mar 11, 2023

Hi! We are working on improving the single-package workflow with turborepo. @tknickman has been working on a PR that addresses some of this and will follow up to make sure that this exact case is covered.

@arlyon arlyon removed the needs: triage New issues get this label. Remove it after triage label Mar 11, 2023
@mehulkar
Copy link
Contributor

I added a failing test for this in #4240 and left a pointer on how to fix it. Will try to get back to it some time next week, but feel free to pick it up @stefanofa if you have an idea of how to fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants