hope you’re doing well. i’m following a tutorial ( from 2019 ), and i’m facing this error at the moment. here’s the code. ( let me know if you need anything else ) // index.js // // User.js // // auth.js // Thank you in advance. The Lord be with you and save you all, your families and …
Tag: node.js
How to create dto of an complex object in NestJs
I’m a beginner at NestJs and I want to create a dto of the following struct: I want to create an API that can return this object using DTOs. I tried the following dto but I got an error in the service provider : I create 3 classes OneSessionResponseDto, SessionsResponseDto, and WeekResponseDto so I can …
JSON empty when is called from another file
I’m learning NodeJS and MongoDB. I dont know what is happening with this function. If I make a console.log before return user, it works fine (just print an JSON array with all info of the collection) The problem is when I call it from another file (in my case, the router). If I do this, I receive an emp…
Axios request works only on second request
I am building a user login system and currently the way I have it set up, the user types in their email and password and then that information is sent to my server to be checked if accurate. If it is, I create a JWT token and send it back along with the mongodb _id of the user, I then
reply from group chat (telegram bot – support) (NODE JS)
help please, I am writing a telegram bot for feedback, at the moment it works in a private chat (i.e. the user writes to the bot – I answer reply the bot via reply and the user receives SMS from the bot), but does not work in the group chat( in a group I can see the user’s messages, but
Negative or Positive Number to 32 Bit Binary Data in JS
I want to convert a number to 32 Bit binary data. When I try to convert a number to 16 bit or 8 bit data, there is no any problem. But When I try 32 Bit, result is not correct. 8 Bit example: -1 & 255 //result -> 255 or -1 & 0xFF //result -> 255 16 Bit example: -1
pnpm in monorepo – how to run a command only in a specific package?
Let’s say I want to install a package in a specific package in my monorepo, how do I do this from root? in npm, you can do this with something like this: I searched the docs and I can’t find a way to do this in pnpm. Answer It is called “filtering” in pnpm docs (see it here). In this
How to parse multiple div with same class name in a div in cheerio?
I have “n” number of classes with className: “classparent” In which I have “n” number of classes with className: “class1” which consists of “n” number of div’s with className: “class2” How can I parse each and every of these div.cla…
Node.js: The registration token is not a valid FCM registration token
I am developing a Flutter mobile app. From my Nodejs backend, I am trying to send FCM Notifications to the app. I downloaded the private key file from firebase console’s project settings. Below is my Nodejs code. Below is the content in my service-account.json file In my Flutter app, below is how I get …
Invalid array length allocation failed
I have the following script: Output I’m receiving this error when trying to run my JS: FATAL ERROR: invalid array length Allocation failed – JavaScript heap out of memory I’ve checked other similar posts that say to increase the memory size f.x., node –max-old-space-size=16000 yourFile…