turbo
turbo copied to clipboard
Regression unable to use comments anymore in `turbo.json`
What version of Turborepo are you using?
1.2.11
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Mac
Describe the Bug
In the past JSON5 support was added to turbo.json
but adding // comment
now breaks with:
error unmarshalling invalid character '/' looking for beginning of object key string
ERROR turbo.json: invalid character '/' looking for beginning of object key string
Expected Behavior
Able to use JSON5 format in turbo.json
to allow comments
To Reproduce
Add a comment e.g.
"test": {
// "dependsOn": ["^build"],
"outputs": ["coverage/junit.xml"]
},
Huh, it looks like this doesn't even work if I check out the commit that json5
support was added in. Weirdly, comments in some other locations work.
{
"pipeline": {
// This works
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]
}
}
}
vs
{
"pipeline": {
"build": {
// This doesn't work
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]
}
}
}
I guess we need to move to a better json5
library.
Oh no, that's a bummer. I would have sworn this was working. I will see if I can resolve it myself later this week
@bguedes-moz Awesome, thank you :))
I'd also like to suggest adding to the documentation that JSON5 is supported. I didn't know about that until looking through the GitHub issues. Perhaps something here like "turbo.json
supports JSON5, so it can include comments."
This is working for me today, maybe this can be closed?
Yup, fixed in #1472