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] - turbo gen workspace >>> r.flatMap is not a function #5471

Closed
solomon-bush opened this issue Jul 6, 2023 · 3 comments · Fixed by #5712
Closed

[turborepo] - turbo gen workspace >>> r.flatMap is not a function #5471

solomon-bush opened this issue Jul 6, 2023 · 3 comments · Fixed by #5712
Assignees
Labels
kind: bug Something isn't working

Comments

@solomon-bush
Copy link

What version of Turborepo are you using?

1.10.7

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

npm

What operating system are you using?

Mac

Describe the Bug

Command

~/Workspaces/LogHarvestor/log-harvestor ❯ turbo gen workspace              

Error

>>> Unexpected error. Please report it as a bug:
r.flatMap is not a function

Expected Behavior

Trying to follow this guide -> https://turbo.build/repo/docs/core-concepts/monorepos/code-generation

To Reproduce

run turbo gen workspace from root of a turbo repo

ENV information:

OS: Apple M1 Pro - macOS: 13.4.1 (22F82)
NPM: 9.8.0
NODE: 20.4.0
TURBO: 1.10.7

Reproduction Repo

No response

@solomon-bush solomon-bush added area: turborepo kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Jul 6, 2023
@chris-olszewski
Copy link
Member

Hi @solomon-bush, can you include the value of your workspaces field in your root package.json?

@chris-olszewski chris-olszewski added needs: author input and removed needs: triage New issues get this label. Remove it after triage labels Jul 17, 2023
@dmaevac
Copy link

dmaevac commented Jul 25, 2023

I see this issue too, I think this could caused by workspaces being an object when properties like nohoist are used, for example:

  "workspaces": {
    "packages": [
      "packages/*"
    ],
    "nohoist": [
      "**/jest-extended",
      "**/jest-extended/**"
    ]
  },

There looks to be a PR pending that aims to resolve the issue: #5439

@tknickman
Copy link
Member

Available now in turbo@canary.

To test with gen, you'll need to also pass one additional arg - npx turbo@canary gen --tag canary

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