Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hobbitronics opened this issue Oct 26, 2023 · 0 comments
Open

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

hobbitronics opened this issue Oct 26, 2023 · 0 comments
Assignees
Labels
bug Something isn't working needs triage

Comments

@hobbitronics
Copy link

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)
@hobbitronics hobbitronics added bug Something isn't working needs triage labels Oct 26, 2023
@jakobrosenberg jakobrosenberg self-assigned this Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants