PalisadoesFoundation / talawa-api

API Backend for the Talawa Mobile App. Click on the link below to see our documentation
https://docs.talawa.io/
GNU General Public License v3.0
209 stars 712 forks source link

Rectify the ExperimentalWarning: Watch mode on starting the API app #2227

Open palisadoes opened 5 months ago

palisadoes commented 5 months ago

Describe the bug

When you run the API app, the following message is shown on the CLI that recommends that watch mode is deprecated.

$ npm run dev

> talawa-api@1.0.0 dev
> concurrently  "tsx --watch ./src/index.ts" "graphql-codegen --watch"

[0] (node:127742) ExperimentalWarning: Watch mode is an experimental feature and might change at any time
[0] (Use `node --trace-warnings ...` to show where the warning was created)

To Reproduce

Expected behavior

Actual behavior

Screenshots

image

Additional details

Potential internship candidates

Please read this if you are planning to apply for a Palisadoes Foundation internship:

pranshugupta54 commented 4 months ago

Watch mode is still experimental for v20.10.0 node version. We can suppress the warning to just turn off the warning but it won't change anything else.

Do you want to turn the warning off? It's not recommended to turn off any warnings, we might miss out important updates about watch in future.

pranshugupta54 commented 4 months ago

Alternate way is to use nodemon instead of watch mode of node.

github-actions[bot] commented 4 months ago

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

ARYANSHAH1567 commented 3 days ago

When i run the API i dont get any such warning, so i guess this issue should be closed[ Screenshot 2024-09-12 193842 ]

palisadoes commented 3 days ago

@ARYANSHAH1567 Please check to see whether the messages have been suppressed, versus fixed. We have a history of people taking short cuts to create apparent best practice behavior.

ARYANSHAH1567 commented 3 days ago

@ARYANSHAH1567 Please check to see whether the messages have been suppressed, versus fixed. We have a history of people taking short cuts to create apparent best practice behavior.

I looked into the thing and found out that to suppress the warning we have to write the "dev": "NODE_NO_WARNINGS=1 concurrently \"tsx --watch ./src/index.ts\" \"graphql-codegen --watch\"" in package.json but in the current package.json the command is "dev": "concurrently \"tsx --watch ./src/index.ts\" \"graphql-codegen --watch\"" which does not suppress the warning. So mostly i guess the issue is fixed