Open olrtg opened 1 month ago
also need export StrapiLocale
for setting out request
instead types error import type { StrapiLocale } from '@nuxtjs/strapi/dist/runtime'
v5
is not the default should be somewhere in the docs. Could be tricky as the default version of Strapi is now 5. The module has not been fully tested for v5. locale
can be null.@reslear would the StrapiLocale
be a composable? Not sure what you mean there.
As you guys might know, I'm not actively maintaining this repository. Would you mind telling me once everything is good so I can release a major version?
✅ 1, 3 - fixed
i was thinking maybe we could just do it like v4 without generics ?
like data | data []
I'm also thinking of exporting types like
import type { StrapiLocale } from '#nuxt-strapi/types';
I also keep the same types between projects, I suggest adding StrapiDynamicZone
, StrapiComponent
, StrapiImage
, StrapiSeo
.
For dynamic editor I suggest to add information about
@reslear 2 sounds great to me. About the other points idk. I just started using this module and Strapi, so I don't know much yet.
Hi guys, I'm trying to use useStrapi module (V5), nuxt can't find useStrapi, however I can use useStrapiUser, UseStrapiToken, useStrapiAuth, etc... do you know why?
@Zellokr Do you use the latest Edge version?
Yes, as devDepencencies
Could you try npm:@nuxtjs/strapi-edge@1.12.0-28818224.f53bdf9
(latest release), sometimes the latest
tag don't work that well.
It works, however type error "V5" in nuxt.config.ts still appears.
Thank you! :)
✅ 1, 3 - fixed
- i was thinking maybe we could just do it like v4 without generics ? like
data | data []
- I'm also thinking of exporting types like import type { StrapiLocale } from '#nuxt-strapi/types';
- I also keep the same types between projects, I suggest adding
StrapiDynamicZone
,StrapiComponent
,StrapiImage
,StrapiSeo
.For dynamic editor I suggest to add information about
import type { Strapi4ResponseData } from "@nuxtjs/strapi";
This did work in strapi v4, but seems broken now.Stopping by here from the Strapi team (as I work for Strapi) to mention that if anyone needs any information clarity on how something works or help maintain or build support for Strapi 5 please don't hesitate to stop by our Discord: https://discord.strapi.io
Or if you are in dire need of some information for this module you can email me directly: derrick.mehaffy@strapi.io (please don't send emails asking for normal application support but if it's related to this module then it's all good).
Thanks!
Just released a v2.0.0
, let me know if you encounter any issue with it!
Okie! Will do
I'm creating this general issue to collect some feedback from other people about the work done in past PRs to support Strapi 5 and how we can improve it. If you want it, maybe I create separate issues to track these individually.
After installing the module myself and using v5 for a while in a personal project I've found the following:
nuxt.config.ts
file:interface
instead of atype
as the generic type of theuseStrapi<T>()
composable it will not give you the correct types. This didn't happen to me on the v4 composable and I don't even know if this is fixable (because it seems to be a TS thing) but I guess at least we should tell people to usetype
s instead ofinterface
s in the docs, or even better, try to find a workaround. In my opinion, users should not be bothered with this and they should be able to use both if they want. I've created a small repro here: https://tsplay.dev/WYxeQm.find
request to a collection to query all elements, thelocale
key has anull
value, which differs from the current typelocale?: string
, I think it should belocale?: string | null
instead:For now, that's what I've found. Let me know what you think!
Related PRs: