#How do you create server-only files?

8 messages · Page 1 of 1 (latest)

fleet herald
#

In SvelteKit, modules inside server folders or those with .server.ts extension can only be imported by other server modules. Trying to import such files in files that could run on the client will result in an error.

I know server functions exist, but I want make sure files that contain Drizzle table schemas, for example, cannot be imported on the client. Or am I thinking about this wrong?

Is there a way to achieve something similar in Start?

robust jay
fleet herald
#

does this mean I have to wrap everything inside functions?

robust jay
#

i usually just wrap my db instance in that

hallow coral