Weekly GitHub Report for Node - 2025-01-06 12:00:14
Weekly GitHub Report for Node
Thank you for subscribing to our weekly newsletter! Each week, we deliver a comprehensive summary of your GitHub project's latest activity right to your inbox, including an overview of your project's issues, pull requests, contributors, and commit activity.
Table of Contents
I. News
1.1 Recent Version Releases:
The current version of this repository is v23.5.0
1.2 Other Noteworthy Updates:
II. Issues
2.1 Top 5 Active Issues:
We consider active issues to be issues that that have been commented on most frequently within the last week.
-
vm.compileFunction results in an abort: This issue involves a bug in the Node.js
vm
subsystem where usingvm.compileFunction
with certain cached data results in an abort instead of handling the error gracefully. The expected behavior is for the system to throw an exception or similar error-reporting mechanism rather than aborting the entire Node.js process.- The comments discuss the involvement of the Node.js
vm
team, with one user expressing interest in contributing to the solution and being encouraged to proceed. Another user inquires about the progress of the issue, and a final comment suggests that the problem may be related to a V8 issue, as the cached data should not be mixed betweenvm.Script
andvm.compileFunction
. - Number of comments this week: None
- The comments discuss the involvement of the Node.js
-
vm.runInContext Function Prototype Issue: This issue involves a problem with the Node.js
vm
module where function prototypes defined within a script usingvm.runInContext
do not matchFunction.prototype
. The user is seeking a solution to ensure that all functions defined withinvm.runInContext
share the sameFunction.prototype
, despite attempts with proxies and custom constructors being unsuccessful.- The comments explain that the behavior is expected because syntactically created functions do not use injected globals, including the
Function
constructor. The user acknowledges this explanation and seeks further advice on ensuring functions share the sameFunction.prototype
. It is clarified thatFunction.prototype
is "undeniable" and cannot be changed, prompting a question about the user's overarching goal. - Number of comments this week: None
- The comments explain that the behavior is expected because syntactically created functions do not use injected globals, including the
-
Document differences between Node.js fetch() implementations and the standard: This issue is about documenting the differences between Node.js's
fetch()
implementation and the standardfetch()
API, highlighting specific variations such as the addition ofnew Response(asyncIterable)
, cookie handling, and the absence of forbidden headers. The goal is to enhance the documentation by providing users with a clear understanding of these differences, potentially by incorporating information from undici's README.- The comments discuss the need for better documentation of Node.js's
fetch()
differences, with suggestions to use undici's README as a source. There is agreement on the importance of this documentation, as current resources are insufficient. A user expresses interest in contributing, and another confirms the task is available, leading to a pull request being initiated. - Number of comments this week: None
- The comments discuss the need for better documentation of Node.js's
-
Build:
--fully-static
is broken with 23.5.0: This issue reports a problem with the--fully-static
build option in version 23.5.0 of a project, which fails to build a node binary on a Docker amd64 platform running on AWS Fargate, while other versions work fine. The error logs indicate warnings related to string operations and memory allocation, and a specific error related to a shared object during the build process.- The comments discuss the issue's reproduction and potential causes, with one user suggesting that the problem might be linked to a recent update to SQLite. Another user provides a detailed error message related to a shared library test, suggesting a workaround but noting it may not be a complete solution, especially in cross-compiling scenarios.
- Number of comments this week: None
-
node:sqlite: "VACUUM INTO" gives error "no such function: floor": This issue is about a bug encountered when using the
VACUUM INTO
command in thenode:sqlite
subsystem, which results in an error stating "no such function: floor" when thefloor
function is used in a generated column. The problem occurs on a Windows platform and is suspected to be related to SQLite being compiled without theSQLITE_ENABLE_MATH_FUNCTIONS
option, which disables certain math functions likefloor
.- The comments discuss that the issue is likely due to the absence of math functions in the SQLite compilation, specifically pointing out that
floor()
and other math functions likeCEIL
are not enabled. One commenter confirms this suspicion, while another shares a similar experience and suggests enabling these functions by default unless there is a valid reason not to. - Number of comments this week: None
- The comments discuss that the issue is likely due to the absence of math functions in the SQLite compilation, specifically pointing out that
2.2 Top 5 Stale Issues:
We consider stale issues to be issues that has had no activity within the last 30 days. The team should work together to get these issues resolved and closed as soon as possible.
As of our latest update, there are no stale issues for the project this week.
2.3 Open Issues
This section lists, groups, and then summarizes issues that were created within the last week in the repository.
Issues Opened This Week: 14
Summarized Issues:
- Node.js
vm
Module Function Prototype Mismatch: This issue involves a problem with the Node.jsvm
module where function prototypes defined within a script usingvm.runInContext
do not matchFunction.prototype
. The user is seeking a solution to ensure that all functions defined within this context share the sameFunction.prototype
. This discrepancy can lead to unexpected behavior when functions are executed within thevm
context.
- Unhandled Promise Rejection Behavior in Docker: This issue describes a problem where Node.js version 18.19.0 running in a Docker container fails to exit as expected upon encountering an unhandled promise rejection. Instead of exiting, it only issues a warning, which contradicts the expected behavior of the Node.js process exiting after such an event. This behavior has been the default since Node.js version 15, leading to confusion and potential issues in error handling.
- Race Condition in
child_process.execFile
: This issue describes a bug in Node.js where thechild_process.execFile
function may resolve with incomplete output due to a race condition. This occurs when a child process exits with code 0 but some data remains unread, leading to the destruction ofstdout
andstderr
streams. The user suggests improvements such as better documentation or changes to the stream handling behavior to address this inconsistency.
- Makefile Misconfiguration for Coverage Report: This issue is about a misconfiguration in the Makefile for the
coverage-test
target, where the path to thecxxcoverage.html
file is incorrectly set. The incorrect path causes difficulties in obtaining the C++ coverage report, which is essential for developers to assess code coverage. Correcting the path would streamline the process of generating and accessing coverage reports.
- ThreadSafeFunction Error in Multithreaded Environment: This issue involves a bug in Node.js version 18.20.5 where using a ThreadSafeFunction in a multithreaded environment causes an EXC_BAD_ACCESS error. This error occurs in worker threads and does not appear in Node.js versions 20 and 22. The problem is suspected to be related to changes introduced between versions 18.18.2 and 18.19.0, affecting stability in multithreaded applications.
- Excessive RAM Usage with
fs.promises.rm
: This issue describes a problem where usingfs.promises.rm
to recursively delete a large directory tree without sufficient permissions can lead to excessive RAM usage. This can result in potential out-of-memory (OOM) exceptions, particularly on Microsoft Windows NT 10.0.22631.0 x64. The expected behavior would be to fail due to permission issues rather than consuming excessive resources.
- SQLite Subsystem Error on Windows: This issue involves an error encountered in the node:sqlite subsystem on Windows when executing the
VACUUM INTO
command. The command fails with the message "no such function: floor" due to the absence of thefloor
function, likely because SQLite is compiled withoutSQLITE_ENABLE_MATH_FUNCTIONS
. This affects other math functions likeCEIL
as well, limiting functionality.
- File System Clock API Proposal: This issue is about proposing the addition of a file system clock API in Node.js to reliably compare file system timestamps with the current time. Existing methods like
process.hrtime()
andDate.now()
do not provide a consistent or accurate enough time reference for this purpose. A new API would enhance the precision and reliability of time comparisons in file system operations.
crypto.generatePrime
Execution Priority Issue: This issue describes a problem in Node.js where thecrypto.generatePrime
function has a higher execution priority thanprocess.exit
. This causes the Node.js process to become unresponsive and unable to terminate when attempting to exit immediately after generating a large prime number. Adjusting the execution priority could resolve this unresponsiveness.
- SQLite Extensions Test TypeError: This issue involves a recurring error encountered during the SQLite extensions test in Node.js version v24.0.0-pre on a Linux platform. The test fails with a TypeError indicating that the "path" argument must be a string but is received as undefined. This causes the test to exit with status 1, highlighting a need for error handling improvements.
- Lack of Documentation for
tlsSocket.getPeerCertificate()
: This issue highlights the lack of documentation regarding the format of thevalid_from
andvalid_to
strings returned by thetlsSocket.getPeerCertificate()
method in Node.js. The documentation should specify the non-standard format, which appears to be the output of OpenSSL'sASN1_TIME_print
. This would aid developers in parsing these date-time strings correctly.
- Web Crypto API Iterator Support Proposal: This issue is about updating the web crypto implementation to support iterator and async iterator inputs for the
crypto.subtle.digest(...)
method. This change aligns with upcoming changes to the Web Crypto API and aims to extend this support to thecrypto.subtle.sign(...)
andcrypto.subtle.verify(...)
methods. Such updates would enhance the flexibility and usability of the crypto APIs.
- Webcrypto-style Hash Algorithm Argument Proposal: This issue is about proposing a feature to support webcrypto-style hash algorithm arguments in Node.js's crypto hash APIs for consistency. Allowing developers to use both string and object formats when specifying algorithms would align Node.js with the web crypto API. This consistency would simplify the development process for those working across different environments.
2.4 Closed Issues
This section lists, groups, and then summarizes issues that were closed within the last week in the repository. This section also links the associated pull requests if applicable.
Issues Closed This Week: 11
Summarized Issues:
- Assertion Module Failures in Test Runner Context: The assertion module in a test runner context currently signals failures through exceptions, which can lead to unexpected test behavior when these exceptions are caught by the program under test. This issue highlights the need for a mechanism to signal failures through messages instead. Such a change would improve the predictability and reliability of test outcomes.
- Regression in Worker Threads and ESM Loader Hooks: A regression in Node.js version 22.2 removed the ability for worker threads to specify custom ECMAScript Module (ESM) loader hooks. This change impacted projects like Angular CLI that relied on this feature for their server-side generation (SSG) pipeline. A solution is proposed to allow thread workers to register custom ESM loader hooks again.
- CommonJS and ECMAScript Modules Conflict: After updating to version 22.12.0, a conflict between CommonJS (CJS) and ECMAScript Modules (ESM) was encountered, specifically with the
@storybook/addon-webpack5-compiler-babel
preset. This issue led to a ReferenceError and required workarounds such as renaming files or modifying package configurations. The conflict arises because the preset is incorrectly treated as an ESM despite being written in CJS.
- Deprecation of
napi_module_register
Function: There was a request to not deprecate thenapi_module_register
function in Node.js, as its deprecation would require significant refactoring of existing projects. The issue was resolved by removing the deprecation flag. Additionally, plans were made to add more examples for the new embedding API approach.
- SQLite Session Extension Conflict Handling: The SQLite session extension's conflict handling mechanism allows the
SQLITE_CHANGESET_REPLACE
resolution code to be used in invalid situations. This leads to function aborts and errors. Improvements in error handling and documentation clarity are suggested to address these issues.
- Node.js Stream Subsystem Errors: The Node.js stream subsystem has a bug where the
.pipe()
and.pipeTo()
methods fail with specific errors when using a source stream constructed from a Buffer. This issue is particularly problematic with locked ReadableStreams and incorrect chunk types. The errors occur consistently across versions v22.9.0 and v23.4.0 on the Darwin platform.
- Node.js
vm
Module Prototype Discrepancy: There is a problem with the Node.jsvm
module where function prototypes defined within a script usingvm.runInContext
do not matchFunction.prototype
. This discrepancy is demonstrated by a mismatch in expected versus actual prototype equality. The issue highlights inconsistencies in thevm
module's behavior.
- Documentation for SQLite API in Node.js: A discussion was initiated regarding the documentation for the SQLite API in the Node.js project. This issue was referenced in a pull request discussion. The need for comprehensive documentation is emphasized to aid developers in utilizing the SQLite API effectively.
- Discrepancy in Node.js
crypto
Object: There is a discrepancy in Node.js where the interactive shell'scrypto
object behaves differently from therequire('crypto')
module. Since Node.js version 19.0.0, the interactive shell'scrypto
object is identified aswebcrypto
. This behavior is contrary to the expectation that both should be equivalent.
node --run
Command andscript-shell
Configuration: Thenode --run
command does not respect thescript-shell
configuration set in the.npmrc
file. This leads to execution failures on Windows systems when using scripts intended for POSIX shells. In contrast,npm run
orpnpm run
correctly utilize the specified shell.
util.promisify
and Non-Nodeback Style Functions: A function promisified usingutil.promisify
in Node.js never resolves because it does not follow the "nodeback" style, which requires an error-first callback. This leads to confusion as the user expected the promise to resolve and print "handler" and "done". However, only "done" is printed, indicating an issue with the function's callback style.