Skip to content

fix: include netcoredbg-bridge-core.js in npm bundle and correct resolver path#79

Merged
debugmcpdev merged 2 commits into
mainfrom
fix/dotnet-bundle-issue-72
May 21, 2026
Merged

fix: include netcoredbg-bridge-core.js in npm bundle and correct resolver path#79
debugmcpdev merged 2 commits into
mainfrom
fix/dotnet-bundle-issue-72

Conversation

@debugmcpdev
Copy link
Copy Markdown
Collaborator

Summary

Fixes #72 — the .NET adapter was broken in published @debugmcp/mcp-debugger@0.19.0 and 0.20.0. list_supported_languages reported the adapter as installed: true, but attach_to_process failed.

Two layered bugs, plus the test gap that let this ship:

  • bundle-cli.js copied netcoredbg-bridge.js by name but missed its runtime ESM peer netcoredbg-bridge-core.js. tsup inlines into cli.mjs only; the bridge runs as a separate Node child process, so the core file must exist on disk next to the entry. Switched to a recursive .js copy of dist/utils/, matching the convention already used for the js-debug and CodeLLDB vendor directories.
  • DotnetDebugAdapter.ts bundled-NPX candidate path used a stray .. that resolved out of dist/, but the bundle puts the bridge inside dist/. Dropped the .. so the path matches the actual bundled layout.
  • test-bundle.cjs previously asserted only the bridge entry was present; now also asserts netcoredbg-bridge-core.js, so a future broken publish fails the smoke test.

The reproduction described in #72 was confirmed locally on the pre-fix tarball (only netcoredbg-bridge.js shipped) and verified to be fully resolved on the post-fix tarball (all three util files present, resolver path matches the bundled location).

Test plan

  • pnpm --filter @debugmcp/mcp-debugger run build produces a tarball containing both netcoredbg-bridge.js and netcoredbg-bridge-core.js under package/dist/packages/adapter-dotnet/dist/utils/
  • npx vitest run packages/adapter-dotnet/tests/unit/dotnet-bridge-fallback.test.ts — 3/3 pass
  • npm test — 2308/2309 pass locally (one unrelated Rust e2e failure caused by a local Windows toolchain DLL init issue; CI on main is green)
  • CI on this PR runs cleanly across all OSes
  • Optional: end-to-end smoke against the freshly-built tarball with a .NET target (testpublished skill)

🤖 Generated with Claude Code

…t resolver path (#72)

Two layered bugs caused the .NET adapter to ship broken in npm 0.19.0/0.20.0:

1. bundle-cli.js only copied netcoredbg-bridge.js by name, omitting its
   runtime ESM peer netcoredbg-bridge-core.js (which the spawned bridge
   process imports). tsup inlines into cli.mjs only; the bridge runs as a
   separate Node child, so the core file must exist on disk next to the
   entry. Switch to a recursive .js copy of dist/utils/, matching the
   convention used for the js-debug and CodeLLDB vendor directories.

2. DotnetDebugAdapter's bundled-NPX candidate path used '..' to resolve
   out of dist/, but the bundle copies the bridge *inside* dist/. Drop
   the stray '..' so the path matches the actual bundled layout.

Also extend test-bundle.cjs to assert netcoredbg-bridge-core.js is in
the bundle, closing the test gap that allowed this to ship.

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

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@debugmcpdev debugmcpdev merged commit 6629aed into main May 21, 2026
9 checks passed
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.

[BUG] .NET adapter broken in npm publish: netcoredbg-bridge-core.js missing from 0.19.0 and 0.20.0

2 participants