fix: inquirer.prompt is not a function with inquirer v12#413
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Agent-Logs-Url: https://github.com/adobe/aio-cli-plugin-runtime/sessions/3e88d468-cfd9-4f2e-b0ce-08e31d016195 Co-authored-by: shazron <36107+shazron@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix inquirer.prompt is not a function error in log forwarding
fix: inquirer.prompt is not a function with inquirer v12
Apr 27, 2026
There was a problem hiding this comment.
🤖 PR Reviewer
This diff changes the inquirer import to use the .default property, which is the correct way to import ES modules that have been compiled to CommonJS with a default export wrapper. The test file is updated consistently to reflect this change. The modification is minimal and focused.
✅ LGTM! This PR looks good to merge.
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
shazron
approved these changes
Apr 27, 2026
dthampy
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #412
This was a dep change made last year, but recent manual testing has found this bug, during interactive prompt for log forwarding set.
In inquirer v12, the CJS entry point no longer exposes
promptdirectly — it exports{ createPromptModule, default }, with the classic API living ondefault. This causedaio rt namespace log-forwarding setto crash immediately withTypeError: inquirer.prompt is not a function.Changes
src/commands/runtime/namespace/log-forwarding/set.js— destructuredefaulton import soinquirer.promptresolves correctly:test/commands/runtime/namespace/log-forwarding/set.test.js— update mock assignment to target the same property the source now reads from: