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.

LitElement doesn't work when target is 'electron-renderer'

See original GitHub issue

Bug report

What is the current behavior? When I set my build target to ‘electron-renderer’ the app builds fine, but at runtime, I get the error:

Uncaught (in promise) TypeError: h.createComment is not a function
    at r (lit-html.js:15:200)
    at A (lit-html.js:15:947)
    at gui.update (lit-element.js:143:76)
    at gui.performUpdate (reactive-element.js:19:5123)
    at gui.scheduleUpdate (reactive-element.js:19:4770)
    at gui._$Ej (reactive-element.js:19:4678)

When the target is set to ‘web’ everything is rendered as expected.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Create an Electron project using Webpack and LitElement.
  2. Create a build target for your Electron renderer.
  3. Set the target to ‘electron-renderer’.
  4. Build and run.

What is the expected behavior?

The web component should render just as it does with the target set to ‘web’.

Other relevant information: webpack version: 5.74.0 Node.js version: 16.16.0 Operating System: macOS 12.4 Additional tools: Webpack, Electron, LitElement, TypeScript

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cantrellcommented, Oct 20, 2022

Huh. OK. I’ll give it another go. Thanks for looking into it. I’ll reopen if I can reproduce.

1reaction
cantrellcommented, Aug 29, 2022

Setting the target to web is the only workaround I’ve found, but of course that has a lot of disadvantages.

Read more comments on GitHub >

github_iconTop Results From Across the Web

LitElement EventListener() not update render() function
But when I want to show the value obtained from the first component in the second component, the render method doesn't work for...
Read more >
Vue CLI 3: A Game Changer for Front End Development?
Trying to debug why a config you can't see is not working, being unable to ... but having to eject to add `target:...
Read more >
How to Handle Events with LitElement and TypeScript
The handleClick function receives an Event object with more information about it. Open your browser's console and feel free to inspect this ...
Read more >
Events
LitElement doesn't have a specific lifecycle callback called after first ... When working with events and shadow DOM, there are a few things...
Read more >
Lit: basics
lit-element is a simple base class for creating fast and lightweight web components with Lit. What you need ... How it works. This...
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