Custom Plugin: Component and Content-Type creation by startup

Okay - but the error message is confusing.

I add the additional variables like:

  • category
  • modelName
  • globalId
  • uid

and name the component “test.bar” instead of “test.bars”.

const data = {
    collectionName: "components_test_bars",
    category: "test",
    modelName: "bar",
    globalId: "ComponentTestBar",
    uid: "test.bar",
    info: {
      displayName: "bar",
    },
    options: {},
    attributes: {
      foo: {
        type: "string",
      },
    },
  };
  strapi.components["test.bar"] = data;

Now it’s working! :slight_smile:
Thank you @Boegie19

1 Like