Skip to content

"Found a link with a url that isn't resolved" #1390

@frederikhors

Description

@frederikhors

I have this code:

<a
    href={isSomething
        ? undefined
        : `/${labels.plural}/${element.id}`}
>

and I'm getting this:

Found a link with a url that isn't resolved. eslint(svelte/no-navigation-without-resolve)

So I tried with:

<a
    href={isSomething
        ? undefined
        : resolve(`/${labels.plural}/${element.id}`)}
>

and I'm getting errors like this everywhere:

Found a link with a url that isn't resolved. eslint(svelte/no-navigation-without-resolve)

Argument of type '[`/${string}/${string}`]' is not assignable to parameter of type '[route: "/"] | [route: "/others"] | [route: "/others/"] | [route: "/stats"] | [route: "/stats/"] | [route: "/players"] | [route: "/players/"] | [route: "/players/1"] | [route: "/players/1/"] | ... 569 more ... | [route: ...]'.
  Type '[`/${string}/${string}`]' is not assignable to type '[route: "/"] | [route: "/others"] | [route: "/others/"] | [route: "/stats"] | [route: "/stats/"] | [route: "/players"] | [route: "/players/"] | [route: "/players/1"] | [route: "/players/1/"] | ... 471 more ... | [route: ...]'.
    Type '[`/${string}/${string}`]' is not assignable to type '[route: `/teams/${string}/edit/` & {}]'.
      Type '`/${string}/${string}`' is not assignable to type '`/teams/${string}/edit/` & {}'.
        Type '`/${string}/${string}`' is not assignable to type '`/teams/${string}/edit/`'.ts(2345)

What to do?

Thanks for your amazing work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions