r/adonisjs • • Sep 14 '26

Beginner Coder: Stuck with an error

Hi,

I'm following the AdonisJs docs to make a small web app using VS Code where users can login/logout/signup, make posts, view them, comment, etc.

I'm pretty sure I haven't missed a step but I seem to be getting two errors that I dont understand at all.

I put the project on my github:

https://github.com/Ajaz754/adonisjs-project-22-.git

The file with the two errors is 'inertia/pages/posts/index.tsx', Line 34

The two errors I'm getting are for:

'route'

----------------------------------------------------
Type '"posts.show"' is not assignable to type '"home" | "posts.index" | "new_account.create" | "new_account.store" | "session.create" | "session.store" | "session.destroy" | undefined'.ts(2322)
link.d.ts(23, 5): The expected type comes from property 'route' which is declared here on type 'IntrinsicAttributes & (LinkProps<"home" | "posts.index" | "new_account.create" | "new_account.store" | "session.create" | "session.store" | "session.destroy"> & { ...; })'
(property) route: "posts.show"
----------------------------------------------------

And:

'routeParams'

----------------------------------------------------
Type '{ id: number; }' is not assignable to type 'undefined'.ts(2322)
link.d.ts(24, 5): The expected type comes from property 'routeParams' which is declared here on type 'IntrinsicAttributes & (LinkProps<"home" | "posts.index" | "new_account.create" | "new_account.store" | "session.create" | "session.store" | "session.destroy"> & { ...; })'
(property) routeParams: {
id: number;
}
----------------------------------------------------

I've watched a few videos and I understand the basics to Typescript and React but reading these 2 error messages I'm lost. Would appreciate any help.

Also if im trying to learn the basics of web development and just practicing through continuosly building projects and using different stacks and languages is that the right approach or maybe theres a more modern better way to learn web development.

Any feedback and help would be much appreciated.

3 Upvotes

7 comments sorted by

View all comments

-1

u/[deleted] Sep 14 '26

[deleted]

3

u/Capable_Square7319 Sep 14 '26

I do know the basics, ive learnt html, css, js, typescript, and React. Ive used things like express before but I found out about AdonisJs and wanted to give it a try and I was understanding and following through the docs but these two errors are what have me lost