When I install npm i Polymer/lit-element and import it
import {LitElement, html} from '@polymer/lit-element/lit-element.js';
and then run polymer serve
following error shows up:
http://localhost:8081/node_modules/@polymer/lit-element/lit-element.js 404 (Not Found)
I looked up in the node_modules dir and inside the lit-element folder is no lit-element.js ... its missing!
Import is working.
lit-element.js is not installed when installing with npm
my package.json has thees dependencies listed:
"@webcomponents/webcomponentsjs": "^2.0.2",
"@polymer/polymer": "^3.0.2",
"@polymer/lit-element": "^0.5.2"
Try importing from simply: import { html, LitElement } from "@polymer/lit-element";
Also from current README: https://github.com/Polymer/lit-element#bigger-example
Try importing from simply:
import { html, LitElement } from "@polymer/lit-element";Also from current README: https://github.com/Polymer/lit-element#bigger-example
I used the following to remove a warning I was getting in WebStorm and an error when running tests:
import { LitElement, html } from 'lit-element/lit-element.js';
@Anid4u2c you quoted a quite out-of-date import. This package has been named simply lit-element for a lone time now, and you can just import from 'lit-element', you don't need 'lit-element/lit-element.js'
Most helpful comment
Try importing from simply:
import { html, LitElement } from "@polymer/lit-element";Also from current README: https://github.com/Polymer/lit-element#bigger-example