LitElement doesn't work when target is 'electron-renderer'
See original GitHub issueBug 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.
- Create an Electron project using Webpack and LitElement.
- Create a build target for your Electron renderer.
- Set the target to ‘electron-renderer’.
- 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:
- Created a year ago
- Comments:8 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Huh. OK. I’ll give it another go. Thanks for looking into it. I’ll reopen if I can reproduce.
Setting the target to
webis the only workaround I’ve found, but of course that has a lot of disadvantages.