Loopback required the Node Cluster module, which is incompatible with Passenger - node.js

I am trying to deploy my loopback service. But I am encountering a problem where i am unable to access it.
When trying to access I get the following error message:
Trace: You required the Node Cluster module, which is incompatible with Passenger, a non-functional shim was returned and your app may still work. However, please remove the related code as soon as possible.
Now I am not 100% sure this is the reason why I am unable to access it but it is not throwing any other messages.
I've already looked into the problem however I haven't found a solution. It seems that loopback uses something called shirtId which is a node module that uses a cluster function.
Removing this node module will result in my application not being able to start.
Has anyone else had this problem and maybe know of a fix?

Related

Angular Universal with GRPC

Im having issues with setting up GRPC inside Angular Universal App.
Basically, it throws an error:
ERROR Error: This environment's XHR implementation cannot support binary transfer.
This error is breaking the application on production (hosting it on ubuntu and nginx), but, in local envioroment it works.
If I switch Angular to not use SSR, then it works fine.
My assumption is that in the Node Express server I need to add support for GRPC, but im not sure how to achieve that.
Did someone had the same problem?
Thanks!
If no grpc library is defined, adding improbable-eng should solve the issue. The mentioned error message occurs when the transport protocol is not NodeHttpTransport.

Unable to run the angular application. Getting error No such file exists robots933456.txt

I am running the angular application in Microsoft Teams and deploying it on Azure.
But it's not running up as it is looking for the robots933456.txt route.
It wasn’t the case before today.
Please guide me on how to proceed further.
On running the app the logs shows:
The error was natively on my side nothing to do with the above but pretty much seen and raised by people so thought of sharing below:
After doing some research figured out I can safely ignore this message. /robots933456.txt is a dummy URL
the path that App Service uses to check if the container is capable of serving
requests. A 404 response simply indicates that the path doesn't exist, but
it lets App Service know that the container is healthy and ready to respond
to requests.
https://github.com/MicrosoftDocs/azure-docs/issues/32472

How to solve the error SequelizeHostNotFoundError?

Problem essence
Writing the API server in NodeJS (Express) using the PostgreSQL database (connecting to it remotely through the service ElephantSQL and work through Sequelize). Today appeared an error "SequelizeHostNotFoundError". It occurs even in the checked endpoints.
Error text
(it remains only a screenshot of the error)
My attempts to solve the problem
Tried to perform a GET request to my API not via Postman and via the browser (did not help).
Tried to create a new DB on the same service ElephantSQL (didn't help, but migrations to create new tables and relationships somehow executed and endpoints still not working).
Tried to connect to the database directly via IDE DataGrip (connection test is successful and the database is loaded with all the tables).
What could be the problem ? On stackoverflow some wrote that the problem may occur due to the lack of a paid subscription to Google Cloude Functions, but I do not seem to use it. There is an option to connect to PostgreSQL locally, but I want to understand.

Node Mongodb error : No valid replicaset instance servers found

We have multiple APIs running on AWS instance on different ports. One of the API is giving error "No valid replicaset instance servers found". Other APIs is working fine. No messages in mongodb log. Tried all other options mentioned in stackoverflow such as increasing timeout etc. However did not help.
Same API works properly when run on local server. Restarted AWS instance and it started working fine.
Not able to replicate the issue. Any direction to check the root cause. Would like to avoid happening again. Would appreciate any areas to investigate further to find root cause.

What is sense of NodeJS modules without any exports?

If there's any. Im not really into web technologies, but have to understand some awful code written by someone else in Node.
All node.js apps are npm modules once you execute npm init. After that point, you can publish the module by executing npm publish assuming you gave it a unique name in the package.json.
If the app isn't meant to return anything, then there is no need to export anything. However, it's almost always worth exporting something to allow for unit testing deeper than just starting the app as an http server and sending it requests.
It is also sometimes useful to modify the way your app runs based on whether it is being required as a module or executed as an app. For example, say i have an express rest api server. I can run it as a standalone server on api.example.com, and then require it into another application and run it from that application directly to avoid CORS issues without having to duplicate code or deal with git submodules, instead I simply npm install the api into the application that needs it and attach it just like you would a router. www.example.com/api
app.use('/api', require('#myusername/api.example.com'))

Resources