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

[BUG] OpenGraph Types #92

Open
dimitrisganotis opened this issue Nov 14, 2024 · 3 comments
Open

[BUG] OpenGraph Types #92

dimitrisganotis opened this issue Nov 14, 2024 · 3 comments

Comments

@dimitrisganotis
Copy link

dimitrisganotis commented Nov 14, 2024

Bug report

Required System information

  • Node.js version: v20.15.1
  • NPM version: v10.9.0
  • Strapi version: v5.3.0
  • Database: MySQL 8
  • Operating system: Ubuntu 22.04
  • Is your project Javascript or Typescript: Typescript
  • SEO Plugin version: v2.0.4

Describe the bug

When I try to generate the types, I get an error.

strapi ts:generate-types

[INFO] [2024-11-14T15:26:40.452Z] (Typegen) Starting the type generation process
[INFO] [2024-11-14T15:26:40.452Z] (Typegen) Generating types for contentTypes
[INFO] [2024-11-14T15:26:40.668Z] (Typegen) Generating types for components
[ERROR] [2024-11-14T15:26:40.713Z] (Typegen) Failed to generate types for components: ';' expected. (1020:23)
1018 | };
1019 | attributes: {

1020 | og:description: Schema.Attribute.String & Schema.Attribute.Required & Schema.Attribute.SetMinMaxLength<{
| ^
1021 | maxLength: 200;
1022 | }>;
1023 | og:image: Schema.Attribute.Media<"images">;. Exiting
[INFO] [2024-11-14T15:26:40.713Z] (Typegen) The task errored with 0 warning(s) and 1 error(s) in 0.261s.
[2024-11-14 16:26:40.713] info: Shutting down Strapi
[2024-11-14 16:26:40.715] info: Strapi has been shut down

It seems that the new open-graph component doesn't have valid attribute names. A solution would be to remove the "og:" from the attributes.

@Bambalazs
Copy link

Can confirm, this issue is still blocking Strapi to generate contentTypes.d.ts automatically, therefore any new single or collection types cannot be created. As a temporary solution, I had to rename og property names in OpenGraph component.

Screenshot 2024-12-04 at 11 28 17

@abhex
Copy link

abhex commented Dec 4, 2024

`
[ERROR] [2024-12-04T10:18:08.540Z] (Typegen) Failed to generate types for components: ';' expected. (110:23)
108 | };
109 | attributes: {

110 | og:description: Schema.Attribute.String & Schema.Attribute.Required & Schema.Attribute.SetMinMaxLength<{
| ^
111 | maxLength: 200;
112 | }>;
113 | og:image: Schema.Attribute.Media<"images">;. Exiting
[INFO] [2024-12-04T10:18:08.541Z] (Typegen) The task errored with 0 warning(s) and 1 error(s) in 0.418s.
[2024-12-04 15:18:08.541] info: Shutting down Strapi
[2024-12-04 15:18:08.544] info: Strapi has been shut down
`

Can confirm having the same issue.

@KostarSf
Copy link

same issue.

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

4 participants