Lit-Element import statement with unpkg - lit-element

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 lit-element#3.0.0-pre.3/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

Related

Stories not rendering in 6.1.15 version of storybook

My main.js file:
Its not rendering stories inside Header.stories.js
Even I have explicitly included Header.stories.js but still the same issue, it's not being rendered.
Please see if anyone could help me with this as I am really stuck on this issue.
PS: Use following repo to reproduce the issue or to see the implementation!
click here to see the repo
You have this error in the console :
WARNING in ./src/components/Header.stories.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: Storybook_demo/my_storybook/src/components/Header.stories.js: Const declarations require an initialization value (16:20)
14 | }
15 |
> 16 | export const Primary ()=>(<Header >'hii'</Header>);
| ^
I can see the =sign in your file, I honestly don't know why it doesn't work. It's look like a bug in a babel parser ?
However, you can make it work with juste a space between Primary and =:
export const Primary = ()=>(<Header >'hii'</Header>)

Object is not generic (google-maps-react)

Just added google-maps-react along with #types/googlemaps to my project. Now when I attempt to bundle the project I get the below error.
../../node_modules/google-maps-react/index.d.ts:29:14 - error TS2315: Type 'Object' is not generic.
29 type Style = Object<string, string | number | boolean>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What exactly is causing this?
You need to add types for google-maps-react
npm install #types/google-maps-react

Relative Imports for two parents dir up

I have the following directory structure
code
|-----|--experiments
| |---v0
| |---agcnn.py
|-----|--pn
| |---bag
| |--run.py
run.py uses a module inside the agcnn.py. However when I try the import as following:
from experiments.v0.agccn import AG
it gives a relative import error saying no module. I'm using VScode and the the working dir is taken care by Vscode as root which is /code/ in this case.
How can I change the settings to accommodate the import ?

Unable to use module in local folder

I am attempting to create an API wrapper but I am unable to use the wrapper. My __init__.py
from .sb import Skyblock
The folder that contains the module is called skyblock and the file with the Skyblock class is called sb.py
The file I'm trying to use the module in contains this code
from skyblock import *
set_api_key('49baa0d9-ecf3-430d-8669-c08495664889')
uuid = uname_resolver('Metasploitable')
print(get_news())
I am getting an undefined error
Here's the directory structure
C:.
| requirements.txt
| testing.py
|
\---skyblock
| sb.py
| __init__.py
|
\---__pycache__
sb.cpython-37.pyc
__init__.cpython-37.pyc
You are using relative import, so you need to import as
from .skyblock import *
You can refer to this site for more information: PEP-328

Windows 10 failure to compile with Node and React - syntax errors?

I've been trying to start up a React project but can't avoid the following syntax error message. I've tried Yarn only to run into more errors (that would be for another post). My coworkers have no trouble running this on their Macs, so I'm wondering if it's a Windows specific issue? Totally lost on this one:
./src/ducks/auth/index.js
Syntax error: C:/Users/user/code/project/src/ducks/auth/index.js: Unexpected
token, expected ; (5:20)
3 | export * from './constants';
4 |
> 5 | export default from './reducer';
| ^
6 |
7 | export * from './selectors';
Are you importing or exporting? Your syntax looks half and half right now. If you are exporting:
export default <name of function>
if you are importing:
import <name of default function> from './reducer
edit: Now that I look at it, you're obviously importing. When importing, you have to state the exact name of what you exported. There is no keyword default when importing. Also, you need to use import, not export.

Resources