Skip to content

generating typescript models fails for specific space with TypeError: contentTypeValidation.linkContentType.map is not a function #135

Description

@TijmenH

It seems there's an issue with our contentful space that causes the codegen to break. We tried running the codegen in a new organization and it worked perfectly. However trying to generate models on our existing environment throws the following error:

yarn run v1.22.19
$ contentful-typescript-codegen --output types/generated/contentful.d.ts
TypeError: contentTypeValidation.linkContentType.map is not a function
    at renderLink (/node_modules/contentful-typescript-codegen/dist/contentful-typescript-codegen.js:154:76)
    at Object.renderArray [as Array] (/node_modules/contentful-typescript-codegen/dist/contentful-typescript-codegen.js:177:34)
    at (/node_modules/contentful-typescript-codegen/dist/contentful-typescript-codegen.js:232:58
    at Array.map (<anonymous>)
    at renderContentTypeFields (/node_modules/contentful-typescript-codegen/dist/contentful-typescript-codegen.js:218:10)
    at renderContentType (/node_modules/contentful-typescript-codegen/dist/contentful-typescript-codegen.js:205:18)
    at /node_modules/contentful-typescript-codegen/dist/contentful-typescript-codegen.js:291:61
    at Array.map (<anonymous>)
    at renderAllContentTypes (/node_modules/contentful-typescript-codegen/dist/contentful-typescript-codegen.js:291:25)
    at /node_modules/contentful-typescript-codegen/dist/contentful-typescript-codegen.js:271:25
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I assume the problem is with one of our content models but as we have a lot we're not sure how to find out which content type is causing this exactly.

Is there any way we can investigate this or find out where the problem comes from?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions