You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a NodeJS script (NX application), it keeps rebuilding when I change something in the main.ts file while watch mode is set to false (also note that my script is not exiting). "serve": { "builder": "@nrwl/node:execute", "options": { "buildTarget": "engine:build", "inspect": false, "watch": false } },
This script connects to an FTP server, downloads some files, parses them, and interacts with a database.
It exits fine when just using node dist/apps/script/main.js but not when using nx serve script, so it's definitely not my script.
Expected Behavior
I expect my NodeJS script to run once and exit (it works when just executing node dist/apps/script/main.js).
I don't want a script to be rebuilding when I'm just running it.
Steps to Reproduce
Create a NodeJS app
Copy the following code in the main.ts file: async function main() { await new Promise((resolve, reject) => { setTimeout(() => { resolve(); }, 5000); }); }
Ran into the same issue. I opened PR #4083 with a potential fix. The watch option is getting overwritten in the node packages' execute builder. Believe that line can just be removed.
Current Behavior
When running a NodeJS script (NX application), it keeps rebuilding when I change something in the
main.ts
file whilewatch
mode is set tofalse
(also note that my script is not exiting)."serve": { "builder": "@nrwl/node:execute", "options": { "buildTarget": "engine:build", "inspect": false, "watch": false } },
This script connects to an FTP server, downloads some files, parses them, and interacts with a database.
It exits fine when just using
node dist/apps/script/main.js
but not when usingnx serve script
, so it's definitely not my script.Expected Behavior
I expect my NodeJS script to run once and exit (it works when just executing
node dist/apps/script/main.js
).I don't want a script to be rebuilding when I'm just running it.
Steps to Reproduce
main.ts
file:async function main() { await new Promise((resolve, reject) => { setTimeout(() => { resolve(); }, 5000); }); }
main() .catch((err) => console.log(
Something went wrong: ${err})) .finally(() => { console.log('Script executed!!'); });
workspace.json
and target yourserve
command for the NodeJS app you created and add the following options:"inspect": false, "watch": false
Failure Logs
No failure logs.
Environment
nx : Not Found
@nrwl/angular : Not Found
@nrwl/cli : 10.3.2
@nrwl/cypress : 10.3.2
@nrwl/eslint-plugin-nx : 10.3.2
@nrwl/express : Not Found
@nrwl/jest : 10.3.2
@nrwl/linter : 10.3.2
@nrwl/nest : 10.3.2
@nrwl/next : Not Found
@nrwl/node : 10.3.2
@nrwl/react : 10.3.2
@nrwl/schematics : Not Found
@nrwl/tao : 10.3.2
@nrwl/web : 10.3.2
@nrwl/workspace : 10.3.2
typescript : 4.0.5
The text was updated successfully, but these errors were encountered: