E2E dev server fails parsing cpu-features native module #760

Open
opened 2026-06-23 14:04:51 +00:00 by simon · 0 comments
Owner

While validating a workspace tab fix, the dashboard workspace-tabs E2E spec failed before rendering CT-Ops because the Next dev server/Webpack tried to bundle the native cpu-features binding from ssh2.\n\nReproduction from a fresh worktree after pnpm install --frozen-lockfile:\n\nsh\npnpm --dir apps/web test:e2e tests/e2e/dashboard/workspace-tabs.spec.ts\n\n\nObserved failure in the Playwright error context:\n\ntext\nBuild Error\nModule parse failed: Unexpected character '�' (1:0)\n../../node_modules/.pnpm/cpu-features@0.0.10/node_modules/cpu-features/build/Release/cpufeatures.node\nImport trace:\n cpu-features/lib/index.js\n ssh2/lib/protocol/constants.js\n ssh2/lib/protocol/keyParser.js\n ssh2/lib/index.js\n ./lib/host-editor/transport.ts\n ./lib/actions/host-editor.ts\n\n\nBefore manually building the optional native package, the same spec reported:\n\ntext\nModule not found: Can't resolve '../build/Release/cpufeatures.node'\n\n\nThe production build succeeds with placeholder env values:\n\nsh\nBETTER_AUTH_URL=http://localhost:3000 DATABASE_URL=postgresql://ctops:ctops@localhost:5432/ctops pnpm --dir apps/web build\n\n\nRecommendation: adjust the E2E dev-server/Webpack configuration or the host-editor server-action import boundary so native optional ssh2 dependencies are externalized or otherwise kept out of the client/action compilation path. This should restore dashboard E2E coverage without requiring manual native package build steps.

While validating a workspace tab fix, the dashboard workspace-tabs E2E spec failed before rendering CT-Ops because the Next dev server/Webpack tried to bundle the native cpu-features binding from ssh2.\n\nReproduction from a fresh worktree after pnpm install --frozen-lockfile:\n\n```sh\npnpm --dir apps/web test:e2e tests/e2e/dashboard/workspace-tabs.spec.ts\n```\n\nObserved failure in the Playwright error context:\n\n```text\nBuild Error\nModule parse failed: Unexpected character '�' (1:0)\n../../node_modules/.pnpm/cpu-features@0.0.10/node_modules/cpu-features/build/Release/cpufeatures.node\nImport trace:\n cpu-features/lib/index.js\n ssh2/lib/protocol/constants.js\n ssh2/lib/protocol/keyParser.js\n ssh2/lib/index.js\n ./lib/host-editor/transport.ts\n ./lib/actions/host-editor.ts\n```\n\nBefore manually building the optional native package, the same spec reported:\n\n```text\nModule not found: Can't resolve '../build/Release/cpufeatures.node'\n```\n\nThe production build succeeds with placeholder env values:\n\n```sh\nBETTER_AUTH_URL=http://localhost:3000 DATABASE_URL=postgresql://ctops:ctops@localhost:5432/ctops pnpm --dir apps/web build\n```\n\nRecommendation: adjust the E2E dev-server/Webpack configuration or the host-editor server-action import boundary so native optional ssh2 dependencies are externalized or otherwise kept out of the client/action compilation path. This should restore dashboard E2E coverage without requiring manual native package build steps.
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#760
No description provided.