Skip to content

RouteNode typescript error when using $route.path store #533

@hobbitronics

Description

@hobbitronics

Describe the bug

I get the following error when using $route.path

Error: Property 'path' does not exist on type 'never'.
  The intersection 'RouteNode' was reduced to 'never' because property 'isFile' has conflicting types in some constituents. (ts)

Reproduction

do something like this

import { params } from '@roxi/routify'

$: customerIsOnAdminView = $route.path.includes('admin') && isCustomer($user.app_role)

Code works, but I get a ts error. I can just use location.pathname, but thought I'd let you know anyways.

Logs

Error: Property 'path' does not exist on type 'never'.
  The intersection 'RouteNode' was reduced to 'never' because property 'isFile' has conflicting types in some constituents. (ts)

System Info

"@roxi/routify": "^2.18.12",
    "svelte": "^3.55.1",
    "typescript": "^4.9.4"
    "@tsconfig/svelte": "^2.0.1",
macos 13.6 (22G120)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions