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

[Bug]: CI job "PullRequestComments" throws a Javascript exception "ERR_REQUIRE_ESM" #27089

Closed
christophetd opened this issue Oct 4, 2022 · 3 comments
Labels
bug Addresses a defect in current functionality.

Comments

@christophetd
Copy link
Contributor

christophetd commented Oct 4, 2022

The CI job PullRequestComments seems to currently fail on all PRs with the message:


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:1216: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)
    at Object.<anonymous> (/node_modules/@actions/github/lib/github.js:14:19)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220: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'
}

Examples:
https://github.com/hashicorp/terraform-provider-aws/actions/runs/3182346480/jobs/5188171522#logs

https://github.com/hashicorp/terraform-provider-aws/actions/runs/3177802901/jobs/5178645273

@christophetd christophetd added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Oct 4, 2022
@github-actions
Copy link

github-actions bot commented Oct 4, 2022

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.

@jar-b
Copy link
Member

jar-b commented Oct 4, 2022

Hi @christophetd - thanks for reporting. This is being tracked in the upstream action repo here: actions/first-interaction#101. There is an open PR that fixes the issue (not yet merged, disabling via #27037 is a fallback if necessary), but for now we're ignoring this check in PR reviews, so it shouldn't prevent changes from going in.

I'm going to close this issue to focus conversation in the issue/PR above.

@jar-b jar-b closed this as completed Oct 4, 2022
@github-actions github-actions bot removed the needs-triage Waiting for first response or review from a maintainer. label Oct 4, 2022
@github-actions
Copy link

github-actions bot commented Nov 4, 2022

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 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
Development

No branches or pull requests

2 participants