Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to import customElement, property from bundle #1342

Open
ryanwhite04 opened this issue Jun 25, 2024 · 2 comments
Open

How to import customElement, property from bundle #1342

ryanwhite04 opened this issue Jun 25, 2024 · 2 comments

Comments

@ryanwhite04
Copy link

In the docs i'm told to use:

import {LitElement, html} from 'lit';
import {customElement, property} from 'lit/decorators.js';

but if i'm using bundle, only

import {LitElement, html} from 'https://cdn.jsdelivr.net/gh/lit/dist@3/core/lit-core.min.js';

is given.

how do i import customElement and property from jsdelivr.

I can see there is a file "lit-all" at https://cdn.jsdelivr.net/gh/lit/[email protected]/all/ but it doesn't seem to export customElement or property, and neither does lit-core, i get the error

Module '"https://cdn.jsdelivr.net/gh/lit/[email protected]/all/lit-all.min.js"' has no exported member 'property'

Is the decorator module hosted elsewhere?

@ryanwhite04
Copy link
Author

I'm using the documentation at https://lit.dev/docs/getting-started/#use-bundles

@justinfagnani
Copy link
Contributor

Decorators require a compiler, which is typically in a local, npm-using setup, so the bundles don't include the decorators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants