You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build-time / dev-server error in @nativescript/vite (observed on 8.0.11, same code on main).
Description
extractDirectExportedNames (hmr/server/websocket-core-bridge.ts) scans CJS sources for export declarations with regexes like /\bexport\s+(?:const|let|var)\s+.../ — but it never masks comments first. A commented-out line such as:
// export const roundRadiusProperty = ...
still matches, so wrapCommonJsModuleForDevice emits export { roundRadiusProperty } for a binding that doesn't exist. On device this fails at link time:
SyntaxError: Importing binding name 'roundRadiusProperty' cannot be resolved
and the dev-session boot aborts (the error surfaces as an opaque HTTP-ESM instantiation failure).
Repro: @nativescript-community/ui-image@8's index-common.js contains commented-out export const lines; importing it over /ns/m in dev mode reproduces the failure.
Suggested fix
Strip line/block comments (carefully — string literals may contain //) before running the export regexes, or reuse the existing es-module-lexer/CJS analysis pass if available. Masking comments in our patched copy fixed the boot.
Environment: @nativescript/vite 8.0.11, Vite 8.3, iOS simulator.
Activity
aleclarson commentedon Sep 28, 2026
Minimal reproduction: https://github.com/aleclarson/repro/tree/nativescript-11471 — a single Node script (
npm install && node repro.mjs) that exercises the exact upstream function/code path and prints the failure.