chromatic-cli
chromatic-cli copied to clipboard
"Found invalid package.json" just started appearing this morning
Very strange as we didn't change anything in our monorepository but this morning all of our Chromatic tasks are failing with the same error:
Run chromaui/action@v1
with:
projectToken: ***
storybookBuildDir: applications/react/modern/template/storybook-static/src
exitZeroOnChanges: true
✖ Invalid package.json
Found invalid package.json at /home/runner/work/Box/package.json
Make sure this is a valid Node.js package file, is readable, and contains a "scripts" block.
I wonder if there was some sort of transitive dependency bug introduced?
Looks like the Action was update 4 hours ago: https://github.com/chromaui/action - Seems like it might've introduced a regression. Our root-of-repo package.json doesn't need a scripts tag. Instead, it uses nx to execute scripts within the child applications' package.json.
For what it's worth adding an empty scripts tag to my root package.json fixed the issue:
{
"name": "foo",
"scripts": {},
...
}
We are experiencing the same issue for the last 2 days. Unfortunately, your solution @dep is not resolving it for us so hopefully there will be an update in the action itself that will help in our case.
@dep thank you for reporting this issue. We are investigating this. Can you provide us a small reproduction that we can test the action against?
Ours is a monorepository, so we have a package.json that sits at the root of the repo (with no scripts definition).
We then have a folder system like this:
root: package.json
applications/react/app-1
- package.json with "scripts" defined
applications/react/app-2
- package.json with "scripts" defined
Then each "app" has its own github action with the following step:
- uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: 'applications/react/app-1/storybook-static/src'
exitZeroOnChanges: true
I hope this helps reproduce
Thank you so much! We are looking into this and hope to have a resolution soon!
hello @thafryer is there any progress on this issue we dont use scripts in our package.json is there a way to run the commande without having scripts filed in the package.json file ?
Same issue here. No scripts in package.json for now we will add.