Trying to contribute to repo npm run test results in white screen with module resolution error after npm install Windows 10

trying to contribute to GitHub - Foundry376/Mailspring: πŸ’Œ A beautiful, fast and fully open source mail client for Mac, Windows and Linux.

Description

Running npm run test results in Electron launching with a blank white window. The renderer fails during startup and does not complete initialization. However, npm start does succeed in starting the application normally.

The issue occurs after running npm install. The failure reproduces consistently and is not limited to a single platform.

To Reproduce…

Steps to reproduce the behavior:

  1. Clone the repository
  2. Run npm install
  3. Run npm run test
  4. Electron launches with a white screen

Expected Behavior

npm run test should start the test runner successfully and render the application window.

Screenshots

Setup

OS and Version:

Windows 10 Pro x64

Installation Method:
Source build from GitHub repository

Mailspring Version:
Source build

Node and npm:

  • Node 20.x
  • npm 10.x

Additional Context

Error output during test startup:

Error: Package subpath './lib/utils' is not defined by "exports" in W:\Github\Mailspring\app\node_modules\cheerio\package.json

Full stack trace:

index.js:26 Error: Package subpath './lib/utils' is not defined by "exports" in W:\Github\Mailspring\app\node_modules\cheerio\package.json
    at exportsNotFound (node:internal/modules/esm/resolve:317:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:664:9)
    at resolveExports (node:internal/modules/cjs/loader:657:36)
    at Module._findPath (node:internal/modules/cjs/loader:724:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1376:27)
    at Module.a._resolveFilename (node:electron/js2c/renderer_init:2:4859)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1032:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1037:22)
    at Module._load (node:internal/modules/cjs/loader:1199:37)
    at Module.c._load (node:electron/js2c/node_init:2:17993)
    at Module.s._load (node:electron/js2c/renderer_init:2:34480)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
    at Module.require (node:internal/modules/cjs/loader:1470:12)
    at require (node:internal/modules/helpers:147:16)
    at Object.<anonymous> (../src/Utils.js:10:1)
    at Object.<anonymous> (W:\Github\Mailspring\app\node_modules\enzyme\build\Utils.js:497:3)
    at Module._compile (node:internal/modules/cjs/loader:1714:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1848:10)
    at Module.load (node:internal/modules/cjs/loader:1448:32)
    at Module._load (node:internal/modules/cjs/loader:1270:12)
    at Module.c._load (node:electron/js2c/node_init:2:17993)
    at Module.s._load (node:electron/js2c/renderer_init:2:34480)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
    at Module.require (node:internal/modules/cjs/loader:1470:12)
    at require (node:internal/modules/helpers:147:16)
    at Object.<anonymous> (../src/ReactWrapper.js:4:1)
    at Object.<anonymous> (W:\Github\Mailspring\app\node_modules\enzyme\build\ReactWrapper.js:2006:3)
    at Module._compile (node:internal/modules/cjs/loader:1714:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1848:10)
    at Module.load (node:internal/modules/cjs/loader:1448:32)
    at Module._load (node:internal/modules/cjs/loader:1270:12)
    at Module.c._load (node:electron/js2c/node_init:2:17993)
    at Module.s._load (node:electron/js2c/renderer_init:2:34480)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
    at Module.require (node:internal/modules/cjs/loader:1470:12)
    at require (node:internal/modules/helpers:147:16)
    at Object.<anonymous> (../src/index.js:1:1)
    at Object.<anonymous> (W:\Github\Mailspring\app\node_modules\enzyme\build\index.js:42:3)
    at Module._compile (node:internal/modules/cjs/loader:1714:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1848:10)
    at Module.load (node:internal/modules/cjs/loader:1448:32)
    at Module._load (node:internal/modules/cjs/loader:1270:12)
    at Module.c._load (node:electron/js2c/node_init:2:17993)
    at Module.s._load (node:electron/js2c/renderer_init:2:34480)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
    at Module.require (node:internal/modules/cjs/loader:1470:12)
    at require (node:internal/modules/helpers:147:16)
    at Object.<anonymous> (file:///W:/Github/Mailspring/app/spec/spec-runner/spec-runner.ts:3:1)
    at Object.<anonymous> (W:\Github\Mailspring\app\spec\spec-runner\spec-runner.ts:183:3)
    at Module._compile (node:internal/modules/cjs/loader:1714:14)
    at Object.value [as .ts] (W:\Github\Mailspring\app\src\compile-cache.js:145:21)
    at Module.load (node:internal/modules/cjs/loader:1448:32)
    at Module._load (node:internal/modules/cjs/loader:1270:12)
    at Module.c._load (node:electron/js2c/node_init:2:17993)
    at Module.s._load (node:electron/js2c/renderer_init:2:34480)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
    at Module.require (node:internal/modules/cjs/loader:1470:12)
    at require (node:internal/modules/helpers:147:16)
    at Object.<anonymous> (file:///W:/Github/Mailspring/app/spec/spec-runner/spec-bootstrap.ts:15:1)
    at Object.<anonymous> (W:\Github\Mailspring\app\spec\spec-runner\spec-bootstrap.ts:14:3)
    at Module._compile (node:internal/modules/cjs/loader:1714:14)
    at Object.value [as .ts] (W:\Github/Mailspring/app/src/compile-cache.js:145:21)
    at Module.load (node:internal/modules/cjs/loader:1448:32)
    at Module._load (node:internal/modules/cjs/loader:1270:12)
    at Module.c._load (node:electron/js2c/node_init:2:17993)
    at Module.s._load (node:electron/js2c/renderer_init:2:34480)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
    at Module.require (node:internal/modules/cjs/loader:1470:12)
    at require (node:internal/modules/helpers:147:16)
    at setupWindow (file:///W:/Github/Mailspring/app/static/index.js:48:3)
    at window.onload (file:///W:/Github/Mailspring/app/static/index.js:69:5)

Observed dependency tree after npm install:

mailspring@1.17.2 app
β”œβ”€β”€ cheerio@1.2.0
β”œβ”€β”¬ enzyme@3.11.0
β”‚ └── cheerio@1.2.0 deduped
└─┬ juice@11.0.3
  └── cheerio@1.0.0

Observed diff in app/package-lock.json after npm install:

- cheerio@1.1.2
+ cheerio@1.2.0

- electron@39.2.7
+ electron@40.0.0

- undici@7.18.2
+ undici@7.19.1

- @types/node@22.x
+ @types/node@24.x

The behavior reproduces consistently following these changes.