Duolith docs

Errors E0400 to E0499

E0420 Not a web address

Message "address" is not an http or https address, so no browser can open it

Words in italics are filled in when the compiler reports it, such as the element's name or the list of known ones.

Why

browser.open opens a page in the system browser or an in-app browser (Custom Tabs, SFSafariViewController), which show only absolute http and https addresses; iOS stops the app when its in-app browser is given any other, and a javascript: address must never run. An address written as text is checked when the app is built, in the script block and in markup expressions; one built from data is checked when the app runs, and browser.open then fails with this code. It fails too when nothing on the device could open the address, or when a web browser blocked the new tab because browser.open was not called from a press.

How to fix it

Write the address in full, starting with https://, such as https://example.com/terms. Link to a screen of the app with href or navigate() instead. On the web, call browser.open from a press so the browser lets the tab open.

In a terminal

duolith explain E0420

Mentioned in