Skip to content

E2E tests broken on Node 22+: import assert syntax, EADDRINUSE port collisions, missing html-webpack-plugin #745

@pedrotainha

Description

@pedrotainha

Description

Running test:e2e-serve on Node 22+ results in 5 out of 12 test suites failing. The failures are caused by four independent issues in the examples and test infrastructure:

1. Deprecated import ... assert { type: 'json' } syntax (3 suites)

Several rollup-based examples use the deprecated Import Assertions syntax:

import pkg from './package.json' assert { type: 'json' }

Node 22+ removed support for assert in favor of the Import Attributes syntax (with keyword). This causes:

SyntaxError: Unexpected identifier 'assert'

Affected files (6):

  • packages/examples/simple-react-systemjs/host-systemjs/rollup.config.mjs
  • packages/examples/simple-react-systemjs/remote-systemjs/rollup.config.mjs
  • packages/examples/basic-host-remote/rollup-host/rollup.config.mjs
  • packages/examples/simple-react-webpack/host/rollup.config.mjs
  • packages/examples/simple-react-esm/host-esm/rollup.config.mjs
  • packages/examples/simple-react-esm/remote-esm/rollup.config.mjs

2. Port collisions between sequential E2E tests (4 suites)

All examples hardcode the same ports (5000/5001). Tests run sequentially via threads: false, but kill-port in afterAll doesn't always free the port before the next test starts, causing:

Error: listen EADDRINUSE: address already in use 0.0.0.0:5000

Affected examples: webpack-host, simple-react-systemjs, basic-host-remote, simple-react-webpack

3. Server readiness race condition (1 suite)

vue3-advanced-demo times out (60s) because pnpm run serve is spawned without await and page.goto() is called before the Vite preview server is actually listening.

4. Missing html-webpack-plugin dependency (1 suite)

simple-react-webpack/remote/webpack.config.js requires html-webpack-plugin but it's not listed in devDependencies:

Error: Cannot find module 'html-webpack-plugin'

Before / After

Metric Before After
Test suites passed 6/12 11/12
Test suites failed 5/12 0/12
Test suites skipped 1/12 1/12

(vue2-demo remains skipped — pre-existing, unrelated)

Environment

  • Node: 22+ (tested on 24.14.0)
  • vite-plugin-federation: 1.4.1 (main branch)
  • OS: macOS, Linux

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