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

CLI is breaking in production! #192

Closed
Souvikns opened this issue Jan 23, 2022 · 9 comments
Closed

CLI is breaking in production! #192

Souvikns opened this issue Jan 23, 2022 · 9 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Souvikns
Copy link
Member

Souvikns commented Jan 23, 2022

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
@Souvikns Souvikns added the bug Something isn't working label Jan 23, 2022
@imabp
Copy link
Member

imabp commented Jan 23, 2022

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

@Souvikns
Copy link
Member Author

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)

@KhudaDad414
Copy link
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?

@Souvikns
Copy link
Member Author

Souvikns commented Mar 7, 2022

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

@derberg
Copy link
Member

derberg commented Mar 8, 2022

do we know if latest release fixed CLI?

@Souvikns
Copy link
Member Author

Souvikns commented Mar 8, 2022

https://github.com/asyncapi/cli/actions/runs/1922065237 we have to merge another PR to check. But I think the warnings are fixed now.

@pushred
Copy link

pushred commented Mar 8, 2022

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

@Souvikns
Copy link
Member Author

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

@fmvilas
Copy link
Member

fmvilas commented Apr 29, 2022

@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
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants