Skip to content

[lit] Closure Compiler: JSC_UNDEFINED_VARIABLE JSCompiler_renameProperty #3279

@sgammon

Description

@sgammon

Description

Cannot build with Closure Compiler, even in ADVANCED mode with use_types_for_optimization, due to JSCompiler_renameProperty and trustedTypes

Live Demo

See repro here

Steps to Reproduce

  1. Set up an environment with lit-element via npm or yarn (in my case, yarn from bazel)
  2. Write a little sample element that imports lit-element and uses it
  3. Compile it with Closure Compiler in ADVANCED mode, with use_types_for_optimization set to true

Expected Results

Built bundle, with JSCompiler_renameProperty being treated as a special compiler primitive

Actual Results

Instead, it is treated like a regular variable name, which is missing from the compilation unit, yielding a JSC_UNDEFINED_VARIABLE error

Browsers Affected

N/A (Build tooling)

Versions

  • lit-element: v2.4.0 via NPM
  • webcomponents: N/A

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions