turbo: Turborepo cant unmarshall yarn lock generated under (crlf) windows on linux (lf)

What version of Turborepo are you using?

1.0.7

Describe the Bug

context: this repo

On my (windows) pc, all turbo commands work fine, but when i deploy it to vercel, i get the following error:

Running "turbo run build test lint deploy database"
20:15:34.159 | unmarshal
20:15:34.160 | ERROR  yarn.lock: yaml: line 6: mapping values are not allowed in this context
20:15:34.165 | Error: Command "turbo run build test lint deploy database" exited with 1

where line 6 is this image

i assumed this isnt a problem with vercel and something weird going on with the windows to linux differences in yarns lockfile not being reflected in turborepos unmarshalling process

this happens with both v1 and berry lockfiles (slight difference in line number, v2 will fail on the version line under _metadata but follows a similar format to v1, i use v1 here because the docs say v1 is the only supported version and the error is also present there)

Expected Behavior

Turborepo should unmarshall the yarn lock fine and start building

To Reproduce

  1. create a repo that has the scripts database, build, test, lint, deploy, dev (not sure if all of these are necessary)
  2. deploy in production to vercel running all of these (obviously minus dev)
  3. wait for yarn to install
  4. see the error above

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Also run into this issue, in my case, change the yarn.lock file from CRLF to LF fixes the problem.

running into this in a dockerfile

This is still a problem, just hit it today and was not able to find a solution. Ended up removing turbo prune from my Dockerfile as it didn’t work.

Can this issue be reopened?

yarn -O install

Reproducible steps for turborepo-repository:

brew install dos2unix
unix2dos yarn.lock
yarn build

Runing yarn build now gives the following response on maCOS:

❯ yarn build                   
yarn run v1.22.17
$ ./turbow.sh run build --scope=docs
unmarshal
 ERROR  yarn.lock: yaml: line 6: mapping values are not allowed in this context
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@Floffah will give it a shot

Thanks for the write up. Investigating