lit / lit

Lit is a simple library for building fast, lightweight web components.
https://lit.dev
BSD 3-Clause "New" or "Revised" License
18.53k stars 914 forks source link

Adding context without @state causes errors #4248

Closed delaneyj closed 11 months ago

delaneyj commented 11 months ago

Which package(s) are affected?

Lit Core (lit / lit-html / lit-element / reactive-element), Context (@lit-labs/context)

Description

New to Lit but trying to build a declarative 3D scene handler. Want to use context to wire up objects because most don't live within the DOM nor have a render function. I brought up in the Discord help channel and @tbroyer said to create an issue.

Reproduction

https://lit.dev/playground/#gist=2543624c73945ed873ec31e3befb3d93

  1. uncomment line 35 should provide the scene to the context stops demo
  2. unless I uncomment line 36

Workaround

In the playground example

Is this a regression?

No or unsure. This never worked, or I haven't tried before.

Affected versions

v2 playground

Browser/OS/Node environment

Version 116.0.5845.110 (Official Build) unknown (64-bit) Pop OS 22.04

delaneyj commented 11 months ago

It appears this is an issue of using latest lit with older lit-lab/context instead of @lit/context. Sorry for the confusion