Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] Fix
CSSStyleSheet is not defined
error in Node build (#3222)
The recently added `node` build would crash when importing a component that had both `static styles` and used the `@property` decorator. That's because the `@property` decorator causes Lit class initialization at module load time, which ran an `instanceof CSSStyleSheet` check before this PR. Since `CSSStyleSheet` is not defined by default, the error would occur. This PR fixes that by not assuming `CSSStyleSheet` will be defined when in Node mode. Fixes #3218
- Loading branch information
Showing
3 changed files
with
28 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@lit/reactive-element': patch | ||
'lit': patch | ||
--- | ||
|
||
Fix `CSSStyleSheet is not defined` error that would occur when importing a Lit component in Node when both static `styles` and the `@property` decorator were used. |
This file contains 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
This file contains 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