Moleculer: Issue with hot reload w/ moleculer-runner on node 14

Created on 9 Sep 2020  路  9Comments  路  Source: moleculerjs/moleculer

When creating a docker image using FROM node:buster and running the following:

./node_modules/.bin/moleculer-runner --instances=$INSTANCE_CNT -H -c ./config.js --env services/**

I'm getting the following error:

[Runner] The feature watch recursively is unavailable on the current platform, which is being used to run Node.js TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
    at Object.watch (fs.js:1470:11)
    at /usr/src/cute/node_modules/moleculer/src/middlewares/hot-reload.js:281:19
    at Array.forEach (<anonymous>)
    at watchProjectFolders (/usr/src/cute/node_modules/moleculer/src/middlewares/hot-reload.js:276:13)
    at ServiceBroker.started (/usr/src/cute/node_modules/moleculer/src/middlewares/hot-reload.js:330:4)
    at /usr/src/cute/node_modules/moleculer/src/middleware.js:83:50
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  code: 'ERR_FEATURE_UNAVAILABLE_ON_PLATFORM'
}

The hot reload feature works properly when using the current version of node-lts (FROM node:lts-buster).

Version Used: Moleculer v0.14.10

Thank you :)

Core Bug

Most helpful comment

@icebob
I've completed the initial pull request. Let me know if it's acceptable.
It's my first time contributing, though I use moleculer a lot.

All 9 comments

Thanks @intech the investigation. My problem with chokidar that I want to minimalize the number of dependencies in the Moleculer core, so I don't like to add a new lib for hot-reload. Any native alternative solution?

@icebob I fully support your opinion on dependencies.

I have looked into several solutions and my vote for a respected developer https://github.com/mafintosh/recursive-watch

Examples:
https://github.com/gavoja/simple-watcher (maybe leaks)
https://github.com/gmasmejean/watch-recursivly (legacy, high risk leaks)
https://github.com/kbscript/watch-dog (legacy, not interesting)
other very old legacy or many dependencies...

Great, it looks very lightweight with one additional dependencies. Thanks, I will check it.

Any update on this?

@icebob
Have you decided how to move forward with this?

Node v14 is now Active LTS, and v12 has been moved to Maintenance LTS status (as of 2020-11-30). I had to change my Dockerfile to specify FROM node:erbium-buster to keep using moleculer-runner in its current form.

I would be willing to make a pull request if you know which library you would like to use.

@savearray2 Thanks, I think we should try the recursive-watch.

@icebob
I've completed the initial pull request. Let me know if it's acceptable.
It's my first time contributing, though I use moleculer a lot.

Merged!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

darky picture darky  路  5Comments

Kamil93 picture Kamil93  路  3Comments

ngraef picture ngraef  路  3Comments

rozhddmi picture rozhddmi  路  4Comments

maitrucquynhq111 picture maitrucquynhq111  路  3Comments