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

IntelliJ Idea: If filename doesn't match the custom element name, designer can't open a .ts file #2381

Closed
OlliTietavainenVaadin opened this issue Feb 10, 2021 · 2 comments
Labels
bug Impact: Low Less than 15% of users are affected by the issue.

Comments

@OlliTietavainenVaadin
Copy link
Member

Steps to reproduce

  • Create a file named custom-element.ts in the frontend folder of a Vaadin 14.5.0.alpha3 project
  • Insert the following content:
import {LitElement, html} from 'lit-element';
import '@vaadin/vaadin-text-field/vaadin-text-field.js';
import '@vaadin/vaadin-button/vaadin-button.js';

class HelloWorld extends LitElement {

    render() {
        return html`
            <div>
                <vaadin-text-field id="firstInput"></vaadin-text-field>
                <vaadin-button id="helloButton">Click me!</vaadin-button>
            </div>`;
    }
}

customElements.define('hello-world', HelloWorld);

Actual behavior

While the file gets the "Designer" icon, the "Open in Vaadin Designer" button doesn't appear.
If you rename the class to CustomElement and the tag to custom-element, and close and reopen the editor, the Open in Vaadin Designer button appears.

Expected behavior

Either the file can be opened up in Designer, or there's an error indicating that the tag / customelement name must match the filename.

IDE, Designer and OS version

IntelliJ Idea
Designer version: 4.6.2
OS: Windows 10

@tanbt tanbt added the bug label Feb 11, 2021
@tanbt
Copy link
Contributor

tanbt commented Feb 11, 2021

This case may happen when creating the template manually (i.e when TS template hasn't been supported in "New Vaadin 10+ Design" dialog yet #2382), when the template name or content doesn't match LitElement syntaxes, the template isn't recognized by Designer.

I also saw a case when VSCode formats a TS/Lit template from Starter and Designer also can't recognize it anymore.

I would like to follow Vaadin 8 practice: opening an invalid design will show a dialog that indicating the error.

@tanbt tanbt added the Impact: Low Less than 15% of users are affected by the issue. label Feb 11, 2021
@anssit
Copy link
Contributor

anssit commented Aug 3, 2021

Tested with a Vaadin 14.6.7 project from Vaadin Start and Designer 4.6.7. Could not reproduce the issue. Closing.

@anssit anssit closed this as completed Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Impact: Low Less than 15% of users are affected by the issue.
Projects
None yet
Development

No branches or pull requests

3 participants