Fix SSR problems with client only code#602
Merged
bendera merged 5 commits intovscode-elements:mainfrom Feb 21, 2026
Merged
Conversation
Co-authored-by: kiberonlabsdev <210491275+kiberonlabsdev@users.noreply.github.com>
Co-authored-by: kiberonlabsdev <210491275+kiberonlabsdev@users.noreply.github.com>
…support Add SSR guards for CSS stylesheet operations
Member
|
This is not a generic component library, but is intended to be used within a VS Code webview. What real-world use case does this PR address? |
Contributor
Author
|
Exactly as mentioned. The code currently breaks during server side rendering or any other context that doesnt directly have a browser context. The fix introduces zero regression and is easily fixable. It's currently breaking my system and requiring me to use unnecessary libraries to fake a browser context for code that isn't being used but is on the import path |
Member
|
Thanks, merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses SSR problems because of client only code. This PR adds guards and delays so that imports to the vscode library don't cause immediate errors even if the actual imported component isn't one of the 2 components included here