You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[labs/ssr] A way for client code to check if running in server (isSsr) #3158
It would be useful for lit to provide a way to detect if code is running in the server like isSsr so it can be utilized when authoring components to intentionally skip, or provide alternatives for, code that utilizes browser DOM APIs or otherwise are incompatible with SSR.
This is a better alternative to adding no-op DOM shims to alleviate errors during SSR.
Idea for implementation would be to utilize conditional exports to provide a module that will only be available/truthy in node.
changed the title [-][core & ssr] A way for client code to check if running in server (isSsr)[/-][+][labs/ssr] A way for client code to check if running in server (isSsr)[/+]on Jul 22, 2022
Activity
[-][core & ssr] A way for client code to check if running in server (isSsr)[/-][+][labs/ssr] A way for client code to check if running in server (isSsr)[/+]augustjk commentedon Sep 28, 2022
We're looking at calling this
isServerinstead and making it an export fromlit-html, re-exported fromlit.augustjk commentedon Oct 5, 2022
Released now in
[email protected]!