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

browser esm injector fails using extends from class #3671

Closed
6 tasks done
userquin opened this issue Jun 26, 2023 · 2 comments · Fixed by #3681
Closed
6 tasks done

browser esm injector fails using extends from class #3671

userquin opened this issue Jun 26, 2023 · 2 comments · Fixed by #3681

Comments

@userquin
Copy link
Member

Describe the bug

When adding lit example in the new browser PR I've found a problem in examples/lit/src/my-button.ts web component:

imagen

We're not generating the __vi_esm_0. prefix, and so it is failing in L17 in the screenshot below. I can bypass the problem using:

const LitElementClass = LitElement
/**
 * An example button.
 *
 * @slot - This button has a slot
 */
@customElement('my-button')
export class MyButton extends LitElementClass {

imagen

Reproduction

I'm preparing it in the browser PR here in Vitest: #3584

System Info

npx envinfo --system --npmPackages '{vitest,@vitest/*,vite,@vitejs/*}' --binaries --browsers

  System:
    OS: Windows 10 10.0.19044
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 36.39 GB / 63.71 GB
  Binaries:
    Node: 18.16.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (114.0.1823.58)
    Internet Explorer: 11.0.19041.1566

Used Package Manager

pnpm

Validations

@userquin
Copy link
Member Author

userquin commented Jun 26, 2023

Included lit tests in the browser PR, check the web component in the example, to reproduce it just extends from LitElement instead LitElementClass: change to examples/lit and run nr test:browser.

@userquin
Copy link
Member Author

Changed to its own folder in examples: lit-browser.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants