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
{{ message }}
Repository navigation
URL and URLSearchParams globals lack native TypeScript declarations without DOM libs #11456
NativeScript runtime support for URL and URLSearchParams is tracked in #10297, which lists both as available since 8.7. In a NativeScript TypeScript project that omits the browser DOM library, however, TypeScript cannot use these runtime-supported globals through @nativescript/types.
This is a build-time typing report; it does not claim that the runtime constructor is missing.
It would help if @nativescript/types exposed the supported URL and URLSearchParams globals without requiring the full DOM library, or documented the supported typing setup for this case. Enabling all DOM types also declares browser globals such as document that are unavailable in NativeScript apps, so it can hide accidental use of unsupported APIs.
Reproduction
With @nativescript/core 9.1.2, @nativescript/types 9.0.0, TypeScript 5.9.3, and this native compiler configuration:
TS2693: 'URL' only refers to a type, but is being used as a value here.
TS2339: Property 'hostname' does not exist on type 'URL'.
TS2339: Property 'pathname' does not exist on type 'URL'.
TS2339: Property 'searchParams' does not exist on type 'URL'.
Relevant log output (if applicable)
Build-time TypeScript diagnostics shown above. No runtime exception is being reported.
Activity