Conversation
|
✅ Deploy Preview for solid-start-landing-page ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
commit: |
| const DEFAULT_SERVER_PREFIX = "SERVER_"; | ||
| const DEFAULT_CLIENT_PREFIX = "CLIENT_"; | ||
|
|
||
| const SERVER_ONLY_MODULE = `throw new Error('Attempt to load server-only environment variables in client runtime.');`; |
There was a problem hiding this comment.
Can we error on build-time, instead of run-time?
Maybe if it is done after the server-function & tree-shake
There was a problem hiding this comment.
@yinonburgansky This actually yields error on build, but not dev.
fun fact: despite the "throw" side-effect, the missing module exports error yields first on runtime.
This PR adds the
env:serverandenv:clientmodulescloses #2113