Skip to content

CI: @marko/serve browser test suite is broken (toolchain bit-rot) #228

Description

@LuLaValva

Summary

The @marko/serve browser-based autotests (packages/serve/test/index.test.js) fail in CI. The failures are pre-existing toolchain bit-rot, unrelated to any recent feature work — they surfaced while looking at CI for an unrelated PR (#227). The underlying build pipeline is fine (a webpack build produces dist/middleware.js and the dev-server serves a 200 on Node ≥18); the breakage is entirely in the browser test harness and its dependencies.

Prerequisite: CI can't currently run at all

The CI matrix runs on Node 12.x/14.x/15.x, which ship npm 6. npm 6 predates workspaces, so the root npm install never installs the per-package dependencies and the suite dies early with Cannot find module 'mz/fs'. These versions also no longer satisfy the @marko/* engine requirements (18 || 20 || >=22). Bumping the matrix to 18.x/20.x/22.x is a prerequisite for any of the work below to be observable in CI.

The three failure layers (reproduced locally on Node 22)

  1. Puppeteer's bundled Chromium won't launch in CI. puppeteer is pinned at 5.5.0, whose bundled Chromium is from 2020 and fails to launch/navigate on the current ubuntu-latest image → every serve test times out (Navigation timeout of 30000 ms exceeded). Pointing a modern Chromium at the suite locally makes the browser work and ~21/30 pass, which is a completely different signature — confirming the CI-specific cause is the old browser.

  2. Stale HTML snapshots. Even with a working browser, the webpack output has drifted — e.g. an extra <script … async> chunk tag now appears that isn't in the expected *-expected.html snapshots → snapshot mismatches. The expected snapshots need regenerating after the toolchain is updated.

  3. Static param-route regression. The static variant navigating to a dynamic param route (e.g. /blog/123?foo=bar) fails with net::ERR_HTTP_RESPONSE_CODE_FAILURE (fixtures params-and-queries, params-and-queries-deprecated). This looks like a genuine functional regression in static generation / routing for parameterized routes, not just a snapshot diff, and needs investigation.

Suggested approach

  • Bump the CI Node matrix to 18.x/20.x/22.x (and consider actions/checkout / actions/setup-node v4).
  • Upgrade puppeteer to a currently-supported major (API changes expected) so a working Chromium launches in CI.
  • Upgrade webpack-dev-server v3 → v4/v5 to match webpack@5 and adapt packages/serve/src/index.js (it currently uses the v3 API: new DevServer(compiler, config), server.listen(port, host, cb), and v3-only options like contentBase/noInfo/disableHostCheck/injectClient/clientLogLevel).
  • Regenerate the *-expected.html snapshots once the above are in place.
  • Investigate and fix the static param-route ERR_HTTP_RESPONSE_CODE_FAILURE.

Note: @marko/create and @marko/migrate tests are unaffected and pass once dependencies install.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions