← Winnitude! Search  ·  Reader Mode (807 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 18 LINKS

fix(vite): resolve extensionless shared workspace modules over /ns/m by slvs26 · Pull Request #11725 · NativeScript/NativeScript

Repository navigation

fix(vite): resolve extensionless shared workspace modules over /ns/m - #11725


Open
slvs26 wants to merge 1 commit into NativeScript:main from slvs26:fix/vite-ns-m-extensionless-workspace-modules
Open

fix(vite): resolve extensionless shared workspace modules over /ns/m #11725 slvs26 wants to merge 1 commit into NativeScript:main from slvs26:fix/vite-ns-m-extensionless-workspace-modules

Conversation

slvs26 commented Dec 3, 2026



Copy link Copy Markdown

PR Checklist

  • The PR title follows our guidelines.
  • There is an issue for the bug/feature this PR is for.
  • You have read and signed the CLA (signing in a comment on this PR).
  • All existing tests are passing.
  • Tests for the changes are included.

What is the current behavior?

A workspace module outside the Vite root is served at /ns/m/shared/src/screen.tsx but returns 404 at /ns/m/shared/src/screen, the extensionless URL the HMR client uses for re-imports (#11570 ). resolveNsMTransformedModule tries the extension/platform candidates only as Vite root URLs, and its /@fs fallback (resolveFsAnchoredSpec) only anchors the spec as given.

What is the new behavior?

After the existing fallback, the same extension/platform candidates are anchored under the project and workspace roots with resolveFsAnchoredSpec, and the first one Vite transforms is served. The extensionless URL now resolves to the same /@fs module as the URL with the extension. Specs that resolved before take the same path as before, since this runs only after every earlier attempt missed.

Tests:

  • New case in websocket-ns-m-request.spec.ts with the issue's layout (native/ app, shared/src/screen.tsx in the workspace). It checks that both URLs resolve to the same /@fs id. It fails without the change.
  • The full @nativescript/vite suite passes (169 files, 1,968 tests); prettier, eslint and tsc -p tsconfig.lib.json are clean.

Not tested: a device HMR session, or the issue's HTTP reproduction script, which needs a published build.

Closes #11570

🤖 Generated with Claude Code

fix(vite): resolve extensionless shared workspace modules over /ns/m 5e963ba
A workspace module outside the Vite root was served at
/ns/m/shared/src/screen.tsx but 404'd at /ns/m/shared/src/screen, the
extensionless URL HMR uses for re-imports. The /@fs fallback only tried
the spec as given; also anchor its extension/platform candidates under
the project and workspace roots.

Closes NativeScript#11570

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed


No deployments
Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment

Labels

None yet

1 participant