Skip to content

v20.71.0: ESM wrapper imports missing ./index.js (ERR_MODULE_NOT_FOUND) #1356

Done

Description

@fabioriva

Title: v20.71.0: ESM wrapper imports missing ./index.js (ERR_MODULE_NOT_FOUND)

Description

Installing the v20.71.0 Git tag and importing uWebSockets.js from an ES module fails before the native addon is loaded.

The package's exports.import points to ./ESM_wrapper.mjs. That file imports ./index.js, but the installed package contains uws.js and no index.js.

Minimal reproduction

mkdir uws-esm-repro
cd uws-esm-repro
npm init -y
npm install 'uWebSockets.js@github:uNetworking/uWebSockets.js#v20.71.0' --ignore-scripts
node --input-type=module -e 'import * as uWS from "uWebSockets.js"; console.log(typeof uWS.App)'

Actual result

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

Expected result

The ESM entry point resolves the addon loader and exports the public API on a supported native runtime.

Environment

  • uWebSockets.js: v20.71.0, resolved commit 9ec36de
  • Reproduced with Node.js v22.18.0 and v24.14.0
  • npm v11.16.0
  • Linux x64, glibc 2.35

The local glibc version may separately be too old for the newer native binaries. This report concerns the earlier JavaScript module-resolution failure, which occurs before loading any native binary.

Suspected cause

The generated ESM wrapper starts with:

import uws from './index.js';

The package still declares main: "uws.js" and exports.require: "./uws.js". Please check whether the wrapper generator should target ./uws.js instead, or whether index.js was omitted from the release artifact.

Source: https://github.com/uNetworking/uWebSockets.js/blob/v20.71.0/ESM_wrapper.mjs

This report was prepared with assistance from OpenAI Codex. The module-resolution failure was reproduced locally on both Node.js versions listed above.

Activity

  1. uNetworkingAB commented on Oct 16, 2026

    @uNetworkingAB
    Contributor

    Yes it is fixed on master and will be in next release

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions