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] ERROR run failed: error preparing engine: Missing task definition, configure "build" or "___ROOT___#build" in turbo.json #3050

Closed
weyert opened this issue Dec 17, 2022 · 5 comments
Assignees
Labels
kind: bug Something isn't working

Comments

@weyert
Copy link
Contributor

weyert commented Dec 17, 2022

What version of Turborepo are you using?

1.7.0-canary.3

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

npm

What operating system are you using?

Mac

Describe the Bug

I tried to upgrade turbo from version 1.6.3 to 1.7.0-canary.3 and since the upgrade it's throwing the following error:

Running local turbo binary in /Users/weyert/Development/Projects/experiment/node_modules/turbo/bin/turbo

 ERROR  run failed: error preparing engine: Missing task definition, configure "build" or "___ROOT___#build" in turbo.json

while with 1.6.3 it runs as expected:

 Tasks:    1 successful, 2 total
Cached:    0 cached, 2 total
  Time:    12.478s 

Expected Behavior

I would expect that the command turbo run build would succeed running

To Reproduce

Not available yet

Reproduction Repo

No response

@weyert weyert added area: turborepo kind: bug Something isn't working labels Dec 17, 2022
@weyert
Copy link
Contributor Author

weyert commented Dec 17, 2022

Looks like it happens when I have this in the root's package.json:

  "workspaces": {
    "packages": [
      "packages/*",
      "projects/*",
      "examples/*"
    ]
  },

In 1.6.3 it gives an error, which I missed, but in 1.7.0 it acts weird:
1.6.3:

 WARNING  Issues occurred when constructing package graph. Turbo will function, but some features may not be available:  1 error occurred:
        * json: cannot unmarshal object into Go struct field NpmPackage.packages.workspaces of type []string

in 1.7.0:

 ERROR  run failed: error preparing engine: Missing task definition, configure "build" or "___ROOT___#build" in turbo.json

everything starts work when I change the above to:

  "workspaces": [
      "packages/*",
      "projects/*",
      "examples/*"
  ],

@tknickman tknickman self-assigned this Jan 10, 2023
tknickman added a commit that referenced this issue Jan 10, 2023
We were unable to parse an npm lockfile that used the alternate format
for workspaces (`"workspaces": { "packages": [ "packages/**" ]}`)

Error manifested as:
```
 WARNING  Issues occurred when constructing package graph. Turbo will function, but some features may not be available:  1 error occurred:
	* json: cannot unmarshal object into Go struct field NpmPackage.packages.workspaces of type []string
```

Fixes #3207 and
#3050
@tknickman
Copy link
Member

@weyert parsing error should be fixed in the latest canary and will go out with our next release

@weyert
Copy link
Contributor Author

weyert commented Jan 10, 2023

Great thank you!

@tanzeelrana
Copy link

Screenshot 2023-07-05 at 08 36 22

in my case i had the package-lock.json file generated due to a bad command i ran earlier. when i removed the lock file and ran turbo command, it worked :)

@tinytelly
Copy link

for me it was doing this:

  1. remove the package-lock.json
  2. remove the yarn.lock
  3. npm install (puts back a package-lock.json)
  4. turbo build
  5. works now :-)

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

No branches or pull requests

4 participants