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

Failed to construct 'CustomElement': The result must not have attributes #882

Open
yshirsath opened this issue Mar 14, 2024 · 2 comments
Open

Comments

@yshirsath
Copy link

Router.js#247 throws this error when run from Cypress integration tests in our GitHub runner.

Versions:

  • "lit-element": "^2.3.1"
  • "@vaadin/router": "^1.7.2",
  • Github runner: ubuntu-latest

Known Facts:

  • This issue began occurring around 3/5/24. Previously passing tests now fail with this issue when rerun.
  • This issue does not happen when run locally
  • This issue is browser agnostic.
  • Issue does not occur if we remove vaadin router completely from our source
  • Issue does occur with the simplest possible router implementation:

index.ts

const router = new Router(document.querySelector('body'));
router.setRoutes([{path: '/test', component: 'root-view'}], true);

root-view.ts

import { LitElement, html } from "lit-element";

export class RootView extends LitElement {
  render() {
    return html`Hi`;
  }
}

customElements.define("root-view", RootView);

@Artur-
Copy link
Member

Artur- commented Mar 14, 2024

Sounds like you have a custom element with a constructor that sets attributes

@yshirsath
Copy link
Author

Hey @Artur- , thanks for the reply. As you can see there is only one element in our project and it does not in fact have a constructor.

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

No branches or pull requests

2 participants