Skip to content

fix(build): remove duplicate wsToHttpUrl function (#540)#578

Merged
shaun0927 merged 1 commit intodevelopfrom
fix/540-duplicate-wsToHttpUrl
Apr 16, 2026
Merged

fix(build): remove duplicate wsToHttpUrl function (#540)#578
shaun0927 merged 1 commit intodevelopfrom
fix/540-duplicate-wsToHttpUrl

Conversation

@shaun0927
Copy link
Copy Markdown
Owner

Summary

`develop` is currently failing CI on every subsequent push/PR because commit `5527d3f7` accidentally re-declared `wsToHttpUrl` in `src/flutter/vm-service-discovery.ts`. ts-loader surfaces this as TS2323 + TS2393 during `npm run build`, which fails the `lint` and `test` jobs (both run `npm run build` through the `prepare` hook — see `.github/workflows/ci.yml`).

This PR removes the undocumented duplicate (lines 89-92) and keeps the documented one (lines 99-102).

Evidence

Before:
```
src/flutter/vm-service-discovery.ts(89,17): error TS2323: Cannot redeclare exported variable 'wsToHttpUrl'.
src/flutter/vm-service-discovery.ts(89,17): error TS2393: Duplicate function implementation.
server (webpack 5.105.4) compiled with 5 errors in 3458 ms
```

After:
```
server (webpack 5.105.4) compiled successfully in 3391 ms
```

Test plan

  • `npm run build:src` — 0 errors.
  • `npx jest tests/unit/flutter-vm-service.test.ts --no-coverage` — 21/21 pass.
  • `git grep wsToHttpUrl` confirms no caller relied on the duplicate's definition (both were byte-identical).

Why this blocks #540 work

Three in-flight PRs (#575 / #576 / #577) inherit this broken state — their CI will stay red until this lands. Those PRs will rebase after merge.

Refs: #540

🤖 Generated with Claude Code

Commit 5527d3f ("Stabilize the stacked headless smoke jobs") accidentally
re-declared `wsToHttpUrl` in `src/flutter/vm-service-discovery.ts` — the
documented implementation at lines 99-102 is preceded by an identical
undocumented copy at lines 89-92. ts-loader surfaces this as TS2323 +
TS2393 during `npm run build`, which in turn fails the `lint` and `test`
jobs in `.github/workflows/ci.yml` (both run `npm run build` through the
`prepare` hook).

Remove the undocumented duplicate; keep the documented one.

Verified:
- `npm run build:src` now compiles cleanly (0 errors).
- `npx jest tests/unit/flutter-vm-service.test.ts` — 21/21 pass.
- `git blame` confirms the duplicate was introduced on 2026-04-16 and not
  used by any caller outside the file itself.

This hotfix unblocks CI on develop and on every in-flight PR (#575, #576, #577).

Refs: #540

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Owner Author

@shaun0927 shaun0927 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1-line deletion of a duplicate wsToHttpUrl function. All CI green (lint/test/build). Unblocks develop's webpack build and the entire #554 stack.

@shaun0927 shaun0927 merged commit 475e8e8 into develop Apr 16, 2026
3 checks passed
@shaun0927 shaun0927 deleted the fix/540-duplicate-wsToHttpUrl branch April 16, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant