SolidJSS
SolidJSโ€ข11mo agoโ€ข
3 replies
Industrial

Error: Client-only API called on the server side

Hi, I want to add a router to my app and I did it as described on https://docs.solidjs.com/solid-start/building-your-application/routing#creating-new-routes.

I'm getting this error:
Error: Client-only API called on the server side. Run client-only code in onMount, or conditionally


Did I do it wrong? Shouldn't the file based router part be server side rendered? I'm not sure, coming from Next.js that seems logical ๐Ÿ™‚
Documentation for SolidJS, the signals-powered UI framework
Was this page helpful?