Skip to content

fix(benchmarks): bump uWebSockets.js to v20.72.0 - #6247

Open
gesposito wants to merge 2 commits into
nodejs:mainfrom
gesposito:fix/benchmarks-websocket-echo-server
Open

gesposito wants to merge 2 commits into
nodejs:mainfrom
gesposito:fix/benchmarks-websocket-echo-server

Conversation

@gesposito

@gesposito gesposito commented Nov 23, 2026 •

Copy link
Copy Markdown

This relates to...

Rationale

benchmarks/websocket-echo-server.mjs cannot start on main:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../benchmarks/node_modules/uWebSockets.js/index.js'
imported from .../benchmarks/node_modules/uWebSockets.js/ESM_wrapper.mjs

In v20.71.0 the package's ESM_wrapper.mjs imports ./index.js, which is not in the package, so import uws from 'uWebSockets.js' throws. Without the echo server, benchmarks/websocket-benchmark.mjs has nothing to connect to. The WebSocket benchmark is not run in CI, so the bump did not fail anything.

uWebSockets.js v20.72.0, released on 2026-11-24, fixes this. The package now ships index.js as its CommonJS entry point and a generated index.mjs that imports it.

Changes

Bump the uWebSockets.js pin in benchmarks/package.json from v20.71.0 to v20.72.0.

The first commit on this branch worked around v20.71.0 by loading the package through createRequire. The second commit reverts that, so the net change is the pin alone.

Features

N/A

Bug Fixes

  • The WebSocket echo server used by websocket-benchmark.mjs starts again.

Breaking Changes and Deprecations

N/A

Status

Tested on Node.js 24.22.1 (darwin arm64). With v20.72.0 installed: started node websocket-echo-server.mjs, then ran node websocket-benchmark.mjs against it; it completes and reports results for undici, undici stream and ws. With v20.71.0 the same steps fail with the error above. eslint passes.

…rver

The ESM wrapper shipped with uWebSockets.js v20.71.0 imports './index.js',
which does not exist in the package, so the echo server used by
websocket-benchmark.mjs has failed with ERR_MODULE_NOT_FOUND since the
bump from v20.70.0 in nodejs#5856.

Load the CommonJS entry point through createRequire instead. It resolves
to uws.js, which is unchanged across the versions pinned so far.

Refs: uNetworking/uWebSockets.js#1356
v20.72.0 ships index.js (CommonJS) and a generated index.mjs that imports
it, so `import uws from 'uWebSockets.js'` resolves again and the echo
server used by websocket-benchmark.mjs starts.

Bump the pin and go back to the plain import; the createRequire
workaround for v20.71.0 is no longer needed.

Refs: uNetworking/uWebSockets.js#1356
@gesposito gesposito changed the title fix(benchmarks): load uWebSockets.js via require in websocket echo server fix(benchmarks): bump uWebSockets.js to v20.72.0 Nov 25, 2026
@gesposito
gesposito marked this pull request as ready for review November 25, 2026 11:12
@gesposito gesposito changed the title fix(benchmarks): bump uWebSockets.js to v20.72.0 fix(benchmarks): bump uWebSockets.js to v20.72.0 Nov 25, 2026

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L. G. T. M.

@codecov-commenter

codecov-commenter commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.77%. Comparing base (161e78e) to head (3ffd025).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6247      +/-   ##
==========================================
- Coverage   91.77%   91.77%   -0.01%     
==========================================
  Files         113      113              
  Lines       44875    44880       +5     
==========================================
+ Hits        41186    41190       +4     
- Misses       3689     3690       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants