Missing Generic Types After Slice Machine Regenerates Types

Hi everyone,

I've been encountering a type issue recently across various projects. Whenever Slice Machine regenerates the types, all of my generic types seem to go missing afterwards.

In my project, I'm using the following packages:

"@prismicio/client": "^7.11.0",
"@prismicio/next": "^1.7.0",
"@prismicio/react": "^2.9.0",
"next": "14.2.15",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"@slicemachine/adapter-next": "^0.3.51",
"slice-machine-ui": "^2.8.1"
"typescript": "^5.6.3"

Here’s an example:

Has anyone else faced this issue or know how to fix it?

Thanks in advance!

Hi @prismic.p7urh,

I attempted to reproduce the issue you shared with the versions supplied (thanks for that!) but no luck. The types seem to be generated properly with generics filled on my end.

Can you try again with the latest versions available? @slicemachine/adapter-next@^0.3.53 and slice-machine-ui@^2.9.1?

Two things you can also try:

  • Checking the Node version you're running, it should be 18 or later
  • Checking the version of prismic-ts-codegen you have installed, it should be the latest (0.1.22), you can do so by running npm ls prismic-ts-codegen

Let us know about it, happy to help further!

Upgrading the versions fixed the issue. Thanks. :pray: