fix(build): remove duplicate wsToHttpUrl function (#540)#578
Merged
fix(build): remove duplicate wsToHttpUrl function (#540)#578
Conversation
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>
3 tasks
This was referenced Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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