Skip to content

Custom elements without exports are not recognized #122

Open
@baermathias

Description

@baermathias

In my case <api-viewer> is being rendered into the site, but it displays the following:

Bildschirmfoto 2021-12-09 um 10 09 45

What does the json file has to look like, so that custom elements are found inside it? Currently it looks like this:

{
  "schemaVersion": "1.0.0",
  "readme": "",
  "modules": [
    {
      "kind": "javascript-module",
      "path": "src/components/my-button.ts",
      "declarations": [
        {
          "kind": "class",
          "description": "",
          "name": "MyButton",
          "members": [
            {
              "kind": "field",
              "name": "theme",
              "type": {
                "text": "string"
              },
              "default": "''",
              "attribute": "theme"
            },
            {
              "kind": "field",
              "name": "isDisabled",
              "type": {
                "text": "boolean"
              },
              "default": "false",
              "attribute": "disabled"
            },
            {
              "kind": "field",
              "name": "isLoading",
              "type": {
                "text": "boolean"
              },
              "default": "false",
              "attribute": "loading"
            },
            {
              "kind": "method",
              "name": "handler",
              "privacy": "private",
              "parameters": [
                {
                  "name": "e",
                  "type": {
                    "text": "Event"
                  }
                }
              ]
            }
          ],
          "attributes": [
            {
              "name": "theme",
              "type": {
                "text": "string"
              },
              "default": "''",
              "fieldName": "theme"
            },
            {
              "name": "disabled",
              "type": {
                "text": "boolean"
              },
              "default": "false",
              "fieldName": "isDisabled"
            },
            {
              "name": "loading",
              "type": {
                "text": "boolean"
              },
              "default": "false",
              "fieldName": "isLoading"
            }
          ],
          "superclass": {
            "name": "LitElement",
            "package": "lit"
          },
          "customElement": true
        }
      ],
      "exports": [
        {
          "kind": "js",
          "name": "MyButton",
          "declaration": {
            "name": "MyButton",
            "module": "src/components/my-button.ts"
          }
        }
      ]
    }
  ]
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions