moleculerjs / moleculer

:rocket: Progressive microservices framework for Node.js
https://moleculer.services/
MIT License
6.16k stars 587 forks source link

Cannot read property 'remove' of undefined #915

Closed mabc224 closed 3 years ago

mabc224 commented 3 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Current Behavior

Error appear after few min and it disconnect automatically.

Expected Behavior

It should not disconnect and error should not appear.

Context

Failure Logs

[Runner] Cannot read property 'remove' of undefined TypeError: Cannot read property 'remove' of undefined                   at REPL (/d/job-1/search/node_modules/moleculer-repl/src/index.js:39:21)                             at ServiceBroker.repl (/d/job-1/search/node_modules/moleculer/src/service-broker.js:583:11)          at /d/job-omar/boomjam/boomjam-search/node_modules/moleculer/src/runner.js:461:18                                       at processTicksAndRejections (internal/process/task_queues.js:97:5)                
AndreMaz commented 3 years ago

HI @mabc224 can you provide more info and a repro example?

mabc224 commented 3 years ago

actually, it does not show any more info. It is all I have.

image

AndreMaz commented 3 years ago

Can you create a simple repro repo? Also, do you have any custom REPL commands?

mabc224 commented 3 years ago

No, I don't use any custom configuration. All are default.

Sample repo: https://codesandbox.io/s/moleculer-sample-forked-vmtgy

PS: Is it because, I don't have any action with name remove ?

AndreMaz commented 3 years ago

PS: Is it because, I don't have any action with name remove ?

No, it's not. The issue comes from moleculer-repl/src/index.js:39

AndreMaz commented 3 years ago

The repo that you've provided works fine both in codesandbox and on my machine, i.e., I don't see the error image

mabc224 commented 3 years ago

I am using molecular with NATS transporter. and running it in dev mode locally.

I try to set up repo here, but don't have live credentials to use NATS . But you can get an idea by taking a look here. https://codesandbox.io/s/moleculer-sample-forked-bev48

AndreMaz commented 3 years ago

What version are you using? In sandbox it says 0.14.1 but in the OP you indicated 0.14.12.

I've tested the code that you've provided and got the following error: Unable to start all services. TypeError: Cannot read property 'request' of undefined that was caused by disableBalancer: true in moleculer.config file.

However, after upgrading to 0.14.13 the issue disappeared. Can you update your deps and try again?