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

[Repo]: Error in Pull Request Comments Job in GitHub Actions CI for New Contributors #27209

Closed
AhmedGrati opened this issue Oct 12, 2022 · 3 comments
Labels
repository Repository modifications; GitHub Actions, developer docs, issue templates, codeowners, changelog.

Comments

@AhmedGrati
Copy link
Contributor

Description

For the first contributors, when they open a pull request, the job PullRequestComments fails in the action actions/first-interaction@v1.
Here are the logs of the error:

internal/modules/cjs/loader.js:1216
      throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
      ^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /node_modules/@octokit/graphql/index.js
require() of ES modules is not supported.
require() of /node_modules/@octokit/graphql/index.js from /node_modules/@actions/github/lib/github.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /node_modules/@octokit/graphql/package.json.

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:12[16](https://github.com/hashicorp/terraform-provider-aws/actions/runs/3170021436/jobs/5162326582#step:3:17):13)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
    at require (internal/modules/cjs/helpers.js:73:[18](https://github.com/hashicorp/terraform-provider-aws/actions/runs/3170021436/jobs/5162326582#step:3:19))
    at Object.<anonymous> (/node_modules/@actions/github/lib/github.js:14:[19](https://github.com/hashicorp/terraform-provider-aws/actions/runs/3170021436/jobs/5162326582#step:3:20))
    at Module._compile (internal/modules/cjs/loader.js:1[20](https://github.com/hashicorp/terraform-provider-aws/actions/runs/3170021436/jobs/5162326582#step:3:21)0:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1[22](https://github.com/hashicorp/terraform-provider-aws/actions/runs/3170021436/jobs/5162326582#step:3:23)0:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14) {
  code: 'ERR_REQUIRE_ESM'
}

References

Example of the pull request that raises the error: #27057

Would you like to implement a fix?

Yes

@AhmedGrati AhmedGrati added needs-triage Waiting for first response or review from a maintainer. repository Repository modifications; GitHub Actions, developer docs, issue templates, codeowners, changelog. labels Oct 12, 2022
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@breathingdust
Copy link
Member

Closed by #27210

@github-actions github-actions bot removed the needs-triage Waiting for first response or review from a maintainer. label Oct 13, 2022
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
repository Repository modifications; GitHub Actions, developer docs, issue templates, codeowners, changelog.
Projects
None yet
Development

No branches or pull requests

2 participants