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

PR 569 ESM Support breaks the bot #585

Closed
nitrocode opened this issue May 16, 2022 · 0 comments · Fixed by #587
Closed

PR 569 ESM Support breaks the bot #585

nitrocode opened this issue May 16, 2022 · 0 comments · Fixed by #587
Labels

Comments

@nitrocode
Copy link
Contributor

nitrocode commented May 16, 2022

Problem Description

PR #569 ESM Support breaks the bot

Edit: I read the full discussion of the above PR and it seems like a PR is already been submitted to resolve this... but probot/settings is still in a broken state.

What is actually happening

When we run the bot from the HEAD commit after PR #569 was merged, we see the following error

If we roll back to f5d0ecf, then it works correctly.

What is the expected behavior

It should work

Error output, if available

node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/user/git/github/cloudposse/probot/settings/index.js from /Users/user/git/github/cloudposse/probot/settings/node_modules/probot/lib/helpers/resolve-app-function.js not supported.
Instead change the require of index.js in /Users/user/git/github/cloudposse/probot/settings/node_modules/probot/lib/helpers/resolve-a
pp-function.js to a dynamic import() which is available in all CommonJS modules.
    at /Users/user/git/github/cloudposse/probot/settings/node_modules/probot/lib/helpers/resolve-app-function.js:31:65
    at async Object.resolveAppFunction (/Users/user/git/github/cloudposse/probot/settings/node_modules/probot/lib/helpers/resolve-app-function.js:31:17)
    at async combinedApps (/Users/user/git/github/cloudposse/probot/settings/node_modules/probot/lib/run.js:101:27)
    at async Server.load (/Users/user/git/github/cloudposse/probot/settings/node_modules/probot/lib/server/server.js:56:9)
    at async Object.run (/Users/user/git/github/cloudposse/probot/settings/node_modules/probot/lib/run.js:105:9) {
  code: 'ERR_REQUIRE_ESM'
}

Context

Are you using the hosted instance of probot/settings or running your own?

No. I was using the hosted solution and it wasn't working.

We ran it locally to get it to work from the commit described above.

If running your own instance, are you using it with github.com or GitHub Enterprise?

N/A

Version of probot/settings

Latest dd947f5

Version of GitHub Enterprise

N/A

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant