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
Given the input value to this function (code) is not always an int, this line fails but does not report a true/underlying error reason to the user.
I had a scenario where my OS ran out of watcher capacity. That caused the input to the exit function to not be a number:
Sending the received value (code) to process.exit causes this error:
TypeError: The "code" argument must be of type number. Received an instance of Error
at process.set [as exitCode] (node:internal/bootstrap/node:123:9)
at process.exit (node:internal/process/per_thread:188:24)
at process.close (.../node_modules/rollup/dist/shared/watch-cli.js:505:23)
at process.emit (node:events:514:28)
at process.emit (.../node_modules/source-map-support/source-map-support.js:516:21)
at processEmit [as emit] (.../node_modules/rollup/dist/shared/watch-cli.js:336:34)
at process._fatalException (node:internal/process/execution:159:25)
at processPromiseRejections (node:internal/process/promises:289:13)
at processTicksAndRejections (node:internal/process/task_queues:96:32)
Here's the full function:
asyncfunctionclose(code: number | null | undefined): Promise<void> {
process.removeListener('uncaughtException', closeWithError);
// removing a non-existent listener is a no-opprocess.stdin.removeListener('end', close);
if (watcher) awaitwatcher.close();
if (configWatcher) configWatcher.close();
if (code) process.exit(code);
}
In my case, the code value passed to the function is an Error object (as alluded to in the error message), not a number, not null and not undefined:
When I added console.error(code) to debug the scenario (I hacked node_modules/rollup/dist/shared/watch-cli.js), the message emitted was converted to a string by Error.toString(), to:
Error: ENOSPC: System limit for number of file watchers reached, watch '/home/me/mydir/rollup.config.js'
That of course revealed the true problem I had/have, but the default error stack/messaging did not, as the Error object was being type-converted to a string before dispatch to process.exit, thus hiding the actual fault.
The text was updated successfully, but these errors were encountered:
bevand10
changed the title
Fatal Error if code is not an int
Unknown Fatal Error if code is not an int
May 15, 2024
rollup/cli/run/watch-cli.ts
Line 156 in 3520da5
Given the input value to this function (code) is not always an int, this line fails but does not report a true/underlying error reason to the user.
I had a scenario where my OS ran out of watcher capacity. That caused the input to the exit function to not be a number:
Sending the received value (code) to process.exit causes this error:
Here's the full function:
In my case, the code value passed to the function is an Error object (as alluded to in the error message), not a number, not null and not undefined:
When I added console.error(code) to debug the scenario (I hacked node_modules/rollup/dist/shared/watch-cli.js), the message emitted was converted to a string by Error.toString(), to:
Error: ENOSPC: System limit for number of file watchers reached, watch '/home/me/mydir/rollup.config.js'
That of course revealed the true problem I had/have, but the default error stack/messaging did not, as the Error object was being type-converted to a string before dispatch to process.exit, thus hiding the actual fault.
The text was updated successfully, but these errors were encountered: