#Using `@nuxtjs/strapi` with Strapi v5

5 messages · Page 1 of 1 (latest)

tired scarab
#

I'm encountering some issues with autoimport with version 2.0.0 of @nuxtjs/strapi module.

Specifically, it seems that the correct version of useStrapi composable is not being correctly imported. I end up with the composable being either unavailable or available but with an incorrect v4 version instead of the v5, depending on whether I specify v5 as the desired version in the config.

Manually importing the composable does not work either, as it is not included in the modules import.d.ts file in the module's folder within node_modules.

Any fix or workaround would be greatly appreciated! See the link below for issue with more details and a repo with reproduction steps.

https://github.com/nuxt-modules/strapi/issues/457

GitHub

The useStrapi composable is missing when version is set to v5 Version @nuxtjs/strapi: @nuxtjs/strapi-edge 2.0.0-28910259.a188135 nuxt: 3.15.1 Reproduction Link https://github.com/kasperjha/v5-impor...

dusk spadeBOT
#

Hi @tired scarab. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the knowledge sources provided, I don't have specific information about the issue you're experiencing with @nuxtjs/strapi version 2.0.0 and Strapi v5. The knowledge sources don't contain details about this particular version combination or the autoimport issues you're describing.

However, I can provide some general insights based on the available information:

  1. Auto-imports in Nuxt 3 are designed to work with minimal friction, as mentioned in the Migration > Auto Imports documentation. Components and composables are typically auto-imported without explicit imports.

  2. If you're experiencing issues with auto-imports, it might be worth checking the .nuxt/types/components.d.ts and .nuxt/types/imports.d.ts files to see how Nuxt has resolved your components and composable auto-imports.

  3. For third-party packages, Nuxt allows configuring auto-imports in the nuxt.config.ts file. You might want to check if the Strapi module has set up auto-imports correctly for the version you're using.

  4. If the issue persists, it might be a bug or compatibility issue with the specific versions you're using. In such cases, it's recommended to report the bug to the module's repository, as you've already done by creating an issue on GitHub.

Given that this seems to be a specific issue with the @nuxtjs/strapi module, the best course of action would be to wait for a response from the module maintainers on the GitHub issue you've created. They will be in the best position to provide a fix or workaround for this specific problem.

In the meantime, you could try the following general troubleshooting steps:

#
  1. Ensure that all your dependencies are up to date.
  2. Try clearing your Nuxt cache and node_modules, then reinstalling dependencies.
  3. Check if there are any conflicting modules or configurations in your Nuxt project.

If none of these help, you'll likely need to wait for an official response or fix from the module maintainers.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@tired scarab Kapa.ai is still learning and improving, please let me know how I did by reacting below.