test(e2e): CT-Ops dev server cannot bundle ssh2 cpu-features native module #747

Open
opened 2026-06-21 07:45:28 +00:00 by simon · 0 comments
Owner

While validating the CT-Automation Repositories tab E2E flow in a fresh worktree, the Playwright runner could not render /settings/integrations/automation because Next/Webpack failed on the ssh2 -> cpu-features native binding.

Evidence:

  • Command: pnpm --dir apps/web test:e2e tests/e2e/automation/ct-automation-mvp.spec.ts --grep "loads file content"
  • Initial fresh install with ignored build scripts showed Module not found: Can't resolve ../build/Release/cpufeatures.node from cpu-features/lib/index.js.
  • After manually running npm run install inside node_modules/.pnpm/cpu-features@0.0.10/node_modules/cpu-features, the route changed to Module parse failed: Unexpected character while Webpack tried to process build/Release/cpufeatures.node.
  • Import trace includes ssh2/lib/index.js, lib/host-editor/transport.ts, and lib/actions/host-editor.ts.

Impact:
The E2E harness can seed auth and start the app, but tests that navigate to authenticated routes can fail before reaching the target UI because the dev server cannot compile server actions importing host-editor SSH transport dependencies. This blocks reliable browser validation in fresh local worktrees.

Suggested direction:
Keep native SSH dependencies out of Next client/action bundles, or explicitly externalize/load them only in Node server contexts so .node bindings are not parsed by Webpack. Also document or automate the required native build-script approval for local E2E installs.

While validating the CT-Automation Repositories tab E2E flow in a fresh worktree, the Playwright runner could not render `/settings/integrations/automation` because Next/Webpack failed on the `ssh2 -> cpu-features` native binding. Evidence: - Command: `pnpm --dir apps/web test:e2e tests/e2e/automation/ct-automation-mvp.spec.ts --grep "loads file content"` - Initial fresh install with ignored build scripts showed `Module not found: Can't resolve ../build/Release/cpufeatures.node` from `cpu-features/lib/index.js`. - After manually running `npm run install` inside `node_modules/.pnpm/cpu-features@0.0.10/node_modules/cpu-features`, the route changed to `Module parse failed: Unexpected character` while Webpack tried to process `build/Release/cpufeatures.node`. - Import trace includes `ssh2/lib/index.js`, `lib/host-editor/transport.ts`, and `lib/actions/host-editor.ts`. Impact: The E2E harness can seed auth and start the app, but tests that navigate to authenticated routes can fail before reaching the target UI because the dev server cannot compile server actions importing host-editor SSH transport dependencies. This blocks reliable browser validation in fresh local worktrees. Suggested direction: Keep native SSH dependencies out of Next client/action bundles, or explicitly externalize/load them only in Node server contexts so `.node` bindings are not parsed by Webpack. Also document or automate the required native build-script approval for local E2E installs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
carrtech/ct-ops#747
No description provided.