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

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

Open
TijmenH opened this issue Feb 3, 2023 · 0 comments

Comments

@TijmenH
Copy link

TijmenH commented Feb 3, 2023

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?

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

1 participant