DataDog / datadog-ci

Use Datadog from your CI.
https://datadoghq.com
Apache License 2.0
127 stars 55 forks source link

Issue with inquirer-checkbox-plus-prompt dependency, causes errors. #752

Closed chriscasper closed 1 year ago

chriscasper commented 1 year ago

Describe what happened The inquirer-checkbox-plus-prompt dependency is causing errors when trying to build an app due to one of its dependencys. We have submitted a fix for Chalk which inquirer-checkbox-plus-prompt depends on.

This may become an issue for other people as well.

Steps to reproduce the issue: πŸ“

Expected behaviour: πŸ“

Actual behaviour: Error we are seeing when building that's from this dependency issue.

Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/chalk/source/index.js from /node_modules/inquirer-checkbox-plus-prompt/index.js not supported.
Instead change the require of /node_modules/chalk/source/index.js in /node_modules/inquirer-checkbox-plus-prompt/index.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/node_modules/inquirer-checkbox-plus-prompt/index.js:10:13)
    at Object.<anonymous> (/node_modules/@datadog/datadog-ci/dist/commands/lambda/prompt.js:23:28)
    at Object.<anonymous> (/node_modules/@datadog/datadog-ci/dist/commands/lambda/functions/commons.js:21:18)
    at Object.<anonymous> (/node_modules/@datadog/datadog-ci/dist/commands/lambda/instrument.js:38:19)
    at Object.<anonymous> (/node_modules/@datadog/datadog-ci/dist/commands/lambda/cli.js:3:22)
    at Object.<anonymous> (/node_modules/@datadog/datadog-ci/dist/cli.js:24:9) ***
  code: 'ERR_REQUIRE_ESM'
***

Additional context

hershmire commented 1 year ago

This issue has been fixed and released – https://github.com/faressoft/inquirer-checkbox-plus-prompt/pull/21.

lefebvree commented 1 year ago

Thank you, we updated the package and will ship the fix with the next release.

knownasilya commented 1 year ago

Was this released? Getting this

[stderr] 
Error: Cannot find module 'inquirer/lib/prompts/base'
[stderr] 
Require stack:
[stderr] 
- /home/expo/workingdir/build/node_modules/inquirer-checkbox-plus-prompt/index.js
[stderr] 
- /home/expo/workingdir/build/node_modules/@datadog/datadog-ci/dist/commands/lambda/prompt.js
[stderr] 
- /home/expo/workingdir/build/node_modules/@datadog/datadog-ci/dist/commands/lambda/functions/commons.js
[stderr] 
- /home/expo/workingdir/build/node_modules/@datadog/datadog-ci/dist/commands/lambda/instrument.js
[stderr] 
- /home/expo/workingdir/build/node_modules/@datadog/datadog-ci/dist/commands/lambda/cli.js
[stderr] 
- /home/expo/workingdir/build/node_modules/@datadog/datadog-ci/dist/cli.js
[stderr] 
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
[stderr] 
    at Function.Module._load (node:internal/modules/cjs/loader:833:27)
[stderr] 
    at Module.require (node:internal/modules/cjs/loader:1057:19)
[stderr] 
    at require (node:internal/modules/cjs/helpers:103:18)
[stderr] 
    at Object.<anonymous> (/home/expo/workingdir/build/node_modules/inquirer-checkbox-plus-prompt/index.js:14:12)
[stderr] 
    at Module._compile (node:internal/modules/cjs/loader:1155:14)
[stderr] 
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
[stderr] 
    at Module.load (node:internal/modules/cjs/loader:1033:32)
[stderr] 
    at Function.Module._load (node:internal/modules/cjs/loader:868:12)
[stderr] 
    at Module.require (node:internal/modules/cjs/loader:1057:19) {

using "@datadog/datadog-ci": "^2.10.0"

knownasilya commented 1 year ago

Still seeing this with 2.12.0