Skip to content

fix: strip UNC path prefix from resource_dir extensions path for Bun compatibility#514

Merged
j4rviscmd merged 1 commit intomainfrom
fix/unc-ext-resource-path
May 10, 2026
Merged

fix: strip UNC path prefix from resource_dir extensions path for Bun compatibility#514
j4rviscmd merged 1 commit intomainfrom
fix/unc-ext-resource-path

Conversation

@j4rviscmd
Copy link
Copy Markdown
Owner

Summary

On Windows, Tauri's resource_dir() may return paths with the \\?\ extended-length prefix. This prefix breaks Bun's require() in the Extension Host, preventing built-in extensions (git-base, github-authentication, Git, GitHub) from activating in production builds.

This is the same class of issue fixed in #494 (commit d65214d) for CWD-based paths, but the resource_dir() fallback paths (used in production/packaged builds) were missed.

Related Issue

No existing issue — this is a follow-up fix for the partial resolution in #494.

Changes

  • Apply dunce::canonicalize() to all three resource_dir() fallback paths in resolve_extensions_dir():
    • _up_/.build/extensions (packaged extensions)
    • _up_/extensions (legacy path)
    • extensions (direct path)
  • Add documentation comment explaining why the canonicalization is needed

How to Test

  1. Build a production Windows binary (cargo tauri build)
  2. Install and run the app
  3. Verify that built-in extensions (Git, GitHub Authentication) activate successfully
  4. Check that app.log no longer contains Cannot find module '\\?\...' errors

…compatibility

On Windows, Tauri's resource_dir() may return paths with the \\\\?\\ extended-length prefix. This prefix breaks Bun's require() in the Extension Host, preventing built-in extensions (git-base, github-authentication) from activating. Apply dunce::canonicalize() to all three resource directory fallback paths, consistent with the existing CWD-based path resolution.
@j4rviscmd j4rviscmd added bug Something isn't working windows extensions labels May 10, 2026
@j4rviscmd j4rviscmd merged commit 06fa123 into main May 10, 2026
7 checks passed
@j4rviscmd j4rviscmd deleted the fix/unc-ext-resource-path branch May 10, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working extensions windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant