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

Undefined actions property in /api/~node/services?withActions=true causes empty REST API page #331

Open
ggondim opened this issue Aug 28, 2023 · 1 comment

Comments

@ggondim
Copy link

ggondim commented Aug 28, 2023

I have had this bug with the "REST API" page for some time.

Symptoms

  • The "REST API" page is blank:

image

  • Services and actions are accessible via Moleculer Runner:

image

  • Manually calling /api/~node/services?withActions=true does not return any actions:

image

Debugging

Upon delving deep into the problem, I discovered:

  • An uncaught error in view's getServiceActions(svc.actions) due to an undefined actions property:

image
image

  • Applying a console.log to the file moleculer/src/internals.js:L61 shows the withActions parameter as false, even when it's explicitly passed in the request:

image
image

  • Additionally, applying a console.log to the file moleculer/src/registry/service-catalog.js:L117 shows an unrecognized parameter value, as L119 is never reached:

image
image

Help

  • Is this correct? Am I missing something?
  • Should there be improved error handling?
  • How can I assist in rectifying this if it's indeed an error?
ggondim added a commit to ggondim/moleculer-web that referenced this issue Aug 28, 2023
@ggondim
Copy link
Author

ggondim commented Aug 28, 2023

I discovered that mergeParams: false was the cause of this issue.

Developers should continue to use this configuration without experiencing side effects in internal services.

I implemented a minor workaround in src/index.js:L455 to force parameter merging for internal services, and it resolved the issue.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant