Skip to content

CLI is breaking in production! #192

Closed

Description

@Souvikns

Describe the bug

CLI is working fine in the development environment, but in production, it is breaking, no command is usable and most probably this is happening because of some plugin issue.

image

(node:11624) [MODULE_NOT_FOUND] Error Plugin: @asyncapi/cli: Cannot find module '@oclif/plugin-help/lib/command'
Require stack:
- C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@fmvilas\oclif-plugin-spaced-commands\lib\hooks\init.js
- C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@oclif\config\lib\config.js
- C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@oclif\config\lib\index.js
- C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@oclif\command\lib\command.js
- C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@oclif\command\lib\index.js
- C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\bin\run
module: @oclif/[email protected]
task: runHook init
plugin: @asyncapi/cli
root: C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli
See more details with DEBUG=*
(Use `node --trace-warnings ...` to show where the warning was created)
    Error: Unable to load configured help class "./lib/help", failed with message:
    Cannot find module '@oclif/plugin-help/lib/command'
    Require stack:
    - C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\lib\help\CommandHelper.js
    - C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\lib\help\index.js
    -
    C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@oclif\help\lib\util.js
    - C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@oclif\help\lib\comman
    d.js
    -
    C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@oclif\help\lib\index.js
    - C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@oclif\command\lib\com
    mand.js
    - C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@oclif\command\lib\ind
    ex.js
    - C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\bin\run

How to Reproduce

Since we are not using oclif-dev pack there is no way to reproduce this error it is just failing in the production, so to reproduce this error -

  • Install cli globally - npm install -g @asyncapi/cli
  • Try printing cli help - asyncapi --help

Activity

  1. added
    bug
    on Jan 23, 2022
  2. imabp commented on Jan 23, 2022

    @imabp
    Contributor

    I guess this can help.
    heroku/heroku-cli-addons-admin#28

  3. added
    help wanted
    on Jan 25, 2022
  4. Souvikns commented on Jan 27, 2022

    @Souvikns
    MemberAuthor

    I was trying to find from which release this error started and what I found is interesting -

    The CLI works, just throws that warning for some reason.

    image

    v0.7.0 was our first oclif release, and we have the same issue but the help command works
    All in one CLI for all AsyncAPI tools
    
    VERSION
      @asyncapi/cli/0.7.0 win32-x64 node-v16.13.0
    
    USAGE
      $ asyncapi [COMMAND]
    
    TOPICS
      config  access configs
      start   starts a new local instance of Studio
    
    COMMANDS
      config    access configs
      help      display help for asyncapi
      new       creates a new asyncapi file
      validate  validate asyncapi file
    
    (node:13780) [MODULE_NOT_FOUND] Error Plugin: @asyncapi/cli: Cannot find module '@oclif/plugin-help/lib/command'
    Require stack:
    - C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@fmvilas\oclif-plugin-spaced-commands\lib\hooks\init.js
    - C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@oclif\config\lib\config.js
    - C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@oclif\config\lib\index.js
    - C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@oclif\command\lib\command.js
    - C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\node_modules\@oclif\command\lib\index.js
    - C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli\bin\run
    module: @oclif/[email protected]
    task: runHook init
    plugin: @asyncapi/cli
    root: C:\Users\XRIG\AppData\Roaming\npm\node_modules\@asyncapi\cli
    See more details with DEBUG=*
    (Use `node --trace-warnings ...` to show where the warning was created)
    
  5. KhudaDad414 commented on Mar 7, 2022

    @KhudaDad414
    Member

    @Souvikns I see the error log is initiated from fmvilas\oclif-plugin-spaced-commands plugin. can't we use topic seperator instead of this plugin and see if it resolves the issue?

  6. Souvikns commented on Mar 7, 2022

    @Souvikns
    MemberAuthor

    Yeah, @KhudaDad414 we merged this #203 and now we have moved to topic separator. For some reason, it did not trigger a release though

  7. derberg commented on Mar 8, 2022

    @derberg
    Member

    do we know if latest release fixed CLI?

  8. Souvikns commented on Mar 8, 2022

    @Souvikns
    MemberAuthor
  9. pushred commented on Mar 8, 2022

    @pushred

    I'm getting this error running asyncapi validate after a fresh install (am a new user):

    > asyncapi validate
    
    (node:38581) [MODULE_NOT_FOUND] Error Plugin: @asyncapi/cli: Cannot find module '@oclif/plugin-help'
    Require stack:
    - /Users/example/node_modules/@fmvilas/oclif-plugin-spaced-commands/lib/hooks/init.js
    - /Users/example/node_modules/@oclif/config/lib/config.js
    - /Users/example/node_modules/@oclif/config/lib/index.js
    - /Users/example/node_modules/@oclif/command/lib/command.js
    - /Users/example/node_modules/@oclif/command/lib/index.js
    - /Users/example/node_modules/@asyncapi/cli/bin/run
    module: @oclif/[email protected]
    task: runHook init
    plugin: @asyncapi/cli
    root: /Users/example/node_modules/@asyncapi/cli
    

    @asyncapi/[email protected] installed with npm install --save-dev @asyncapi/cli

  10. Souvikns commented on Mar 16, 2022

    @Souvikns
    MemberAuthor

    So this is fixed now due to #203.
    @pushred you can update CLI to ^@0.16.0.

  11. fmvilas commented on Apr 29, 2022

    @fmvilas
    Contributor

    @Souvikns would you mind closing this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions