You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
otherwise only the first occurance is replaced and the defined ContentTypes interface (defined at the very bottom of the generated contentTypes.d.ts) will still extend @strapi/strapi instead of @strapi/types.
Since we only have a dev dependency on @strapi/types in the frontend app, we won't be able to use proper typing when using the the generated schema types with Strapi's Data namespace, e.g. when referring to known custom entities using the type Data.ContentType<'api::my-collection.my-collection'> as described here in the Strapi docs, since the interface extension is not available when importing the Data class from @strapi/types.
With this adjustmend, I was also successfully able to use the generated types in my Vike frontend app using Strapi v5 in Backend.
The text was updated successfully, but these errors were encountered:
In the script
copyTypes.js
, you should replacewith
otherwise only the first occurance is replaced and the defined
ContentTypes
interface (defined at the very bottom of the generatedcontentTypes.d.ts
) will still extend@strapi/strapi
instead of@strapi/types
.Since we only have a dev dependency on
@strapi/types
in the frontend app, we won't be able to use proper typing when using the the generated schema types with Strapi'sData
namespace, e.g. when referring to known custom entities using the typeData.ContentType<'api::my-collection.my-collection'>
as described here in the Strapi docs, since the interface extension is not available when importing theData
class from@strapi/types
.With this adjustmend, I was also successfully able to use the generated types in my Vike frontend app using Strapi v5 in Backend.
The text was updated successfully, but these errors were encountered: