fix(graphql): drop ESM-broken _checkRequirements() so check works (#5654)#5658
Merged
Conversation
…5654) _checkRequirements() called require('axios'), which is undefined in ESM. The ReferenceError was caught and reported the deps as missing, so `npx codeceptjs check` failed with a false 'axios not installed' error. Both call sites (container.js, init.js) guard with `if (._checkRequirements)`, and missing deps already fail at import time, so the method is just removed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
318114d to
d596270
Compare
check works (#5654)check works (#5654)
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.
Fixes #5654
Problem
Running
npx codeceptjs checkwith the GraphQL helper configured throws a false error:even when axios is installed.
Root cause
GraphQL._checkRequirements()(andGraphQLDataFactory._checkRequirements()) calledrequire('axios'). In the ESM buildrequireis undefined, so the line throwsReferenceError: require is not defined. The surroundingcatchswallows it and returns the dependency list as "missing" — a false positive.container.js'scheckHelperRequirements()then throws and blocks the command.Fix
Delete
_checkRequirements()from both helpers entirely. Dependencies are imported at the top of each ESM module, so a genuinely missing dependency fails at import time — the runtime check is redundant. Both call sites (container.js:checkHelperRequirements,command/init.js) already guard withif (Helper._checkRequirements), so removing the method is safe.Verification
Both helpers load, and
_checkRequirementsis nowundefined(skipped by the guards):npx codeceptjs checkno longer reports axios/rosie as missing.🤖 Generated with Claude Code