Skip to content

Commit ba12ab5

Browse files
committed
fix(ui): use lit/directives instead of lit-html/directives for ifDefined
The ifDefined import from 'lit-html/directives/if-defined.js' resolved to lit-html@1.4.1 (via pnpm root node_modules), but LitElement's render() uses lit@2.8.0's template engine. The 2.x renderer doesn't recognize 1.x directive functions (different branding: WeakMap vs _$litDirective$ property), so it stringified the function — causing minified JS code to appear as placeholder text in j-input and other components. Fix: import from 'lit/directives/if-defined.js' which always resolves to the lit-html version bundled with lit@2.8.0.
1 parent ed365f3 commit ba12ab5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/ui/lib/components/input/Input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { LitElement, html, css } from 'lit';
2-
import { ifDefined } from 'lit-html/directives/if-defined.js';
2+
import { ifDefined } from 'lit/directives/if-defined.js';
33
import sharedStyles from '../../shared/styles';
44

55
const styles = css`

packages/ui/lib/components/tab-item/TabItem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { LitElement, html, css } from 'lit';
22
import { state, customElement, property } from 'lit/decorators.js';
3-
import { ifDefined } from 'lit-html/directives/if-defined.js';
3+
import { ifDefined } from 'lit/directives/if-defined.js';
44
import sharedStyles from '../../shared/styles';
55

66
const styles = css`

0 commit comments

Comments
 (0)