E0170 Link to a refused scheme
Words in italics are filled in when the compiler reports it, such as the element's name or the list of known ones.
Why
An href is a path in the app or an http, https, mailto, tel or sms address, written as text (href="...") or as one string in braces (href={"..."}). Any other scheme, such as javascript:, data: or file:, would run code or show content the app did not make when the link is pressed, and on a phone would hand the system an address no app should open. The web runtime, the native engine and both shells refuse the same addresses when they are built from data (decisions 0040 and 0141).
How to fix it
Link to a path such as /settings, or to an http, https, mailto, tel or sms address; to run code when something is pressed, use on:press.
In a terminal
duolith explain E0170
Mentioned in
- Native apps: the app manifest, links, development on a phone and store releases
- Navigation: routes, layouts and the screen stack
- Security
- Types
- 0040. The kit's navigation parts sit on the router: tabs match the route, a tab bar can become a rail, and three new roles
- 0095. Every typed position in markup is checked by TypeScript, through the script view
- 0099. Paths written as text are checked when the app is built
- 0101. The device effects, and how each says a platform cannot
- 0141. Links reach the router through the shell, other sites open in the system, and a dev server reloads the app on a phone
- Link