Skip to content

Server-Side Code Isolation in Start #2671

Answered by ericwilhite
thefrana asked this question in Q&A
Discussion options

You must be logged in to vote

I am experimenting with Start and had the same concerns about leaking sensitive things like db/api credentials and connections.

Couple of options I've found that are worth a test:

  • import 'server-only': I don't particularly like this method because I don't want credentials leaking because of me forgetting to put the import in.

  • vite-env-only: I've not tested this but by the looks of it I'm really hoping it works. I think this + an eslint rule to ensure createsServerFn calls only exist in a **/*.server.* pattern is going to be my preferred path forward.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@thefrana
Comment options

@ericwilhite
Comment options

@thefrana
Comment options

Answer selected by thefrana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants