T
TanStack•14mo ago
wise-white

Typing issue with IntelliJ IDEA

Hi, I noticed the following error on a TR skeleton project (first time TR user following the docs!).
import { createFileRoute } from '@tanstack/react-router'

const Accounts = () => {
return <div>Hello /accounts</div>
}

export const Route = createFileRoute('/accounts')({
component: Accounts
})
import { createFileRoute } from '@tanstack/react-router'

const Accounts = () => {
return <div>Hello /accounts</div>
}

export const Route = createFileRoute('/accounts')({
component: Accounts
})
There's no autocomplete on the possible routes (as the parameter of createFileRoute) and there's the following error:
Argument type "/accounts" is not assignable to parameter type keyof FileRoutesByPath
Argument type "/accounts" is not assignable to parameter type keyof FileRoutesByPath
In VSCode however, no problem! Any ideas ? Thanks
4 Replies
exotic-emerald
exotic-emerald•14mo ago
Make sure you run dev or build The vite plugin will solve this
wise-white
wise-whiteOP•14mo ago
Yeah I'm running dev. No change 😭
extended-salmon
extended-salmon•14mo ago
Have you checked what TS version your IDE is using?
wise-white
wise-whiteOP•14mo ago
@Chris Horobin Same as the project ie. the latest 5.5.4

Did you find this page helpful?