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

"Found invalid package.json" just started appearing this morning #766

Open
dep opened this issue Jun 13, 2023 · 8 comments
Open

"Found invalid package.json" just started appearing this morning #766

dep opened this issue Jun 13, 2023 · 8 comments
Assignees
Labels
bug Classification: Something isn't working customer reported Tracking: This issue was reported through customer support

Comments

@dep
Copy link

dep commented Jun 13, 2023

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?

@dep dep added bug Classification: Something isn't working needs triage Tracking: Issue needs confirmation labels Jun 13, 2023
@dep
Copy link
Author

dep commented Jun 13, 2023

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.

@dep
Copy link
Author

dep commented Jun 13, 2023

For what it's worth adding an empty scripts tag to my root package.json fixed the issue:

{
  "name": "foo",
  "scripts": {},
  ...
}

@jamigibbs
Copy link

jamigibbs commented Jun 15, 2023

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.

@weeksling
Copy link
Contributor

@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?

@dep
Copy link
Author

dep commented Jun 16, 2023

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

@thafryer
Copy link
Member

Thank you so much! We are looking into this and hope to have a resolution soon!

@thafryer thafryer assigned thafryer and unassigned thafryer Jun 17, 2023
@thafryer thafryer added customer reported Tracking: This issue was reported through customer support and removed needs triage Tracking: Issue needs confirmation labels Jun 17, 2023 — with Volta.net
@moussaab-moulim
Copy link

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 ?

@yuchant
Copy link

yuchant commented Apr 22, 2024

Same issue here. No scripts in package.json for now we will add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Classification: Something isn't working customer reported Tracking: This issue was reported through customer support
Projects
None yet
Development

No branches or pull requests

6 participants