Lit-Element import statement with unpkg

625 views Asked by At

I have some projects with Lit-Element and all was fine till today. I had the usual import statement . import {LitElement, html,css,} from "https://unpkg.com/lit-element@latest/lit-element.js?module"; Well I also have the option to install the library via npm but I want it to be the way it was. Any suggestions what is wrong or how to fix it? BTW the error in the browser:

Cannot generate module for [email protected]/lit-element.js

SyntaxError: unknown: Support for the experimental syntax 'nullishCoalescingOperator' isn't currently enabled (14:54):

12 | * subject to an additional IP rights grant found at 13 | * http://polymer.github.io/PATENTS.txt

14 | */var s;const i=t;((s=globalThis).litElementVersions??(s.litElementVersions=[])).push("3.0.0-pre.3");class o extends t{constructor(){super(...arguments),this.I={host:this},this.Φo=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.I).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const r=this.render();super.update(t),this.Φo=e(r,this.renderRoot,this.I)}connectedCallback(){super.connectedCallback(),this.Φo?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.Φo?.setConnected(!1)}render(){return r}}o.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:o}),globalThis.litElementPlatformSupport?.({LitElement:o});const l={O:(t,e,r)=>{t.O(e,r)},P:t=>t.P};export{o as LitElement,i as UpdatingElement,l as _Φ}; | ^ 15 | 16 |

Add @babel/plugin-proposal-nullish-coalescing-operator (https://git.io/vb4Se) to the 'plugins' section of your Babel config to enable transformation.

undefined

0

There are 0 answers