Skip to content

Playwright E2E: vite alias + idaptik-ums sub-build fundamental fix #113

@hyperpolymath

Description

@hyperpolymath

Summary

The Playwright E2E workflow (.github/workflows/e2e-playwright.yml) has been red on main since its introduction in commit 853b1d6 (2026-05-02). PR #112 fixed the outermost layer (the workflow had a typo SHA for denoland/setup-deno@v2 and the @playwright/test package was never declared anywhere) — but that unblocked the actual vite dev-server boot, which then exposed two deeper, pre-existing bugs:

  1. Broken @src/ alias in vite.config.js — the root vite config declares:

    optimizeDeps: {
      include: ['@src/app/tea/AffineTEA.js', '@src/app/tea/AffineTEARouter.js'],
    },

    But the only configured aliases are affinescript: '/src/app/tea' and @tea: '/src/app/tea'. There is no @src alias. Vite reports:

    [WebServer] Failed to resolve dependency: @src/app/tea/AffineTEA.js, present in client 'optimizeDeps.include'
    [WebServer] Failed to resolve dependency: @src/app/tea/AffineTEARouter.js, present in client 'optimizeDeps.include'
    

    The files exist at src/app/tea/AffineTEA.js and src/app/tea/AffineTEARouter.js — the @src/ prefix in optimizeDeps.include is the only thing that needs to change (drop the @, or remove the entry entirely since vite auto-discovers).

  2. idaptik-ums/index.html references src/App.res.mjs which is never built in CIidaptik-ums/src/App.res exists, but the workflow's deno task res:build only compiles the root rescript.json, not idaptik-ums/rescript.json. So idaptik-ums/src/App.res.mjs never materialises:

    [WebServer]   src/App.res.mjs (imported by /home/runner/work/idaptik/idaptik/idaptik-ums/index.html)
    [WebServer] Error: Timed out waiting 60000ms from config.webServer.
    

    Either the workflow needs an additional cd idaptik-ums && rescript build step, or the playwright config should not be serving idaptik-ums/index.html at all (the tests page.goto('/') from the root, so vite should only need root index.html).

Fundamental fix recipe

Layer 1 — vite alias: Edit vite.config.js:

   optimizeDeps: {
-    include: ['@src/app/tea/AffineTEA.js', '@src/app/tea/AffineTEARouter.js'],
+    include: ['/src/app/tea/AffineTEA.js', '/src/app/tea/AffineTEARouter.js'],
   },

Or simply drop the entry — vite will pre-bundle on demand.

Layer 2 — sub-project build: Add to .github/workflows/e2e-playwright.yml after the existing Build ReScript step:

- name: Build ReScript (idaptik-ums)
  run: cd idaptik-ums && npx rescript build || echo "ums ReScript build attempted"

(Mirror the soft-fail pattern of the existing step.)

Layer 3 (verification): Re-run locally with just test-compat (Justfile line 303) on a clean checkout to confirm the vite dev-server boots without unresolved-import warnings, then merge.

Why this isn't folded into PR #112

PR #112 ("non-megaport baseline sweep") deliberately scopes to infrastructure outside the megaport. The deeper layers above are real bugs but they live in the active surface of the migration (the very vite config that wires AffineScript TEA shims into the ReScript app). Fixing them properly requires touching the ReScript→AffineScript compilation pipeline coordination — overlapping with the megaport itself. Keeping them as a tracked follow-up preserves the clean "baseline outside megaport is green; megaport itself is in flight" separation that PR #112's commit message describes as the success criterion.

Acceptance criteria

  • Vite dev-server boots without unresolved-import errors when run via deno task dev:vite
  • Playwright workflow flips to green on at least one of chromium-1080p / firefox-1080p / webkit-1080p
  • tools/compat-testing/tests/{game-loads,accessibility,performance}.spec.js all pass on the chosen browser

Cross-references

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions