question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[labs/context]: Invalid example code

See original GitHub issue

Description

The example given under “Consuming a context” is invalid. The code raises a TypeScript error.

Steps to Reproduce

The code in the example already produces the error. It also imports contextRequest and then uses contextProvided.

Expected Results

The example code should be valid.

Actual Results

Argument of type 'Logger' is not assignable to parameter of type 'ReactiveElement & Record<"logger", Logger>'.
  Type 'Logger' is not assignable to type 'Record<"logger", Logger>'.
    Types of property 'logger' are incompatible.
      Type 'Logger | undefined' is not assignable to type 'Logger'.
        Type 'undefined' is not assignable to type 'Logger'.

Browsers Affected

  • Chrome
  • Firefox
  • Edge
  • Safari 11
  • Safari 10
  • IE 11

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
justinfagnanicommented, Oct 27, 2022

I have a fix for this in https://github.com/lit/lit/pull/3398

1reaction
drk-mtrcommented, Jun 27, 2022

Yep I was suggesting this as a workaround rather than good practice 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

User documentation and Field Lab plan
Field Labs Context. Design of architecture. TITANIUM partners have chosen a general policy to develop their tools, on-premises software ...
Read more >
Sketchup Mirror Component - Niya Strumenti Musicali
Live Components by SketchUp Labs SketchUp Labs. Context-click the component and ... Autocad/Sketchup Video Tutorial Collection-----Need more Tutorials ??
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found