Not getting correct version in @nuxtjs/strapi module
I am trying to implement the
@nuxtjs/strapi
module in my project based on the documentation (https://strapi.nuxtjs.org/setup).
When I am trying to set version: 'v5',
I'm stopped with the error Type '"v5"' is not assignable to type '"v4" | "v3" | undefined'.
.
After further investigations I find that the v5
value isn't even present in the node_modules/@nuxtjs/strapi/dist/module.d.ts
-file. I am using "@nuxtjs/strapi": "^1.12.0"
, which is the newest version.
Does anyone have any tips here?15 Replies
Hi @Helgi. 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 information provided in your question and the available knowledge sources, I don't have specific details about the
@nuxtjs/strapi
module's version support for Strapi v5. However, I can provide some insights and suggestions:
1. The error message you're receiving suggests that the @nuxtjs/strapi
module currently only supports Strapi versions "v4" and "v3" in its type definitions. This aligns with what you've observed in the module.d.ts
file.
2. The @nuxtjs/strapi
module version 1.12.0 might not have been updated yet to support Strapi v5. It's possible that the module maintainers haven't released a version compatible with Strapi v5 at the time of your question.
Here are some suggestions:
1. Check the GitHub repository of the @nuxtjs/strapi
module for any open issues or pull requests related to Strapi v5 support. There might be ongoing work or discussions about adding v5 support.
2. Consider using the "v4" version setting if your Strapi backend is actually v4, as this is the latest supported version according to the type definitions.
3. If you're actually using Strapi v5, you might need to wait for an update to the @nuxtjs/strapi
module that includes v5 support. In the meantime, you could try using the module with the "v4" setting, but be aware that this might lead to compatibility issues.
4. As a workaround, you could try to override the type definitions locally in your project to include "v5" as a valid option. However, this approach doesn't guarantee that the module will work correctly with Strapi v5.
5. Consider reaching out to the maintainers of the @nuxtjs/strapi
module through their GitHub repository to inquire about Strapi v5 support plans.
Remember that using third-party modules sometimes requires staying updated with their development cycles and supported versions. It's always a good idea to check the module's documentation and release notes for the most up-to-date information on version compatibility.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@319191065611599882> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai the documentation @nuxtjs/strapi explicitly use
v5
in their "getting started" example. This should exist...Let me check the knowledge base for you again. One moment! :books:
----------------------
I apologize, but I don't have specific information about the
@nuxtjs/strapi
module or its documentation in the provided knowledge sources. The documents given don't contain any information about this particular module or its version support.
However, based on your statement, it seems there might be a discrepancy between the module's documentation and its actual implementation. If the official documentation for @nuxtjs/strapi
explicitly shows v5
in their "getting started" example, but the module's type definitions don't include it, this could indicate one of several possibilities:
1. The documentation might have been updated ahead of the actual implementation.
2. There could be a bug in the module's type definitions.
3. The documentation might be outdated or incorrect.
To get accurate and up-to-date information about this issue, I recommend:
1. Checking the official GitHub repository for @nuxtjs/strapi
for any recent issues or pull requests related to this discrepancy.
2. Reaching out to the module maintainers directly through their official channels (GitHub issues, discussions, or community forums) to report this inconsistency and seek clarification.
3. Verifying that you're using the latest version of the module, as there might have been a recent update addressing this issue.
If you need further assistance with Nuxt-specific questions, I'd be happy to help based on the information available in the provided knowledge sources.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@319191065611599882> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai In the Github repository I can clearly see support for v5
Let me check the knowledge base for you again. One moment! :books:
----------------------
I apologize, but I don't have direct access to the GitHub repository for the
@nuxtjs/strapi
module in the provided knowledge sources. The information you're referring to is not present in the documents I have been given.
However, based on your statement, it seems that there might be a discrepancy between what you're seeing in the GitHub repository and what you're experiencing in your local project. This could potentially be due to a few reasons:
1. Version mismatch: The version you have installed locally might not be the latest one that includes v5 support.
2. Caching issues: Sometimes, package managers can cache older versions of type definitions.
3. IDE or TypeScript version: Your IDE or TypeScript version might not be picking up the latest type definitions.
To resolve this, you could try the following:
1. Ensure you have the latest version of the module installed.
2. Clear your package manager's cache and reinstall the module.
3. Restart your IDE and/or TypeScript server.
If the issue persists, it would be best to open an issue in the @nuxtjs/strapi
GitHub repository to get direct support from the maintainers. They would be in the best position to help you resolve this discrepancy between the repository content and your local experience.
For Nuxt-specific questions or issues, I'd be happy to assist based on the information available in the provided knowledge sources.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@319191065611599882> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Did you install the latest version? I see "v5" in the module's source: https://github.com/nuxt-modules/strapi/blob/dev/src/module.ts#L42
GitHub
strapi/src/module.ts at dev · nuxt-modules/strapi
Strapi Module for Nuxt. Contribute to nuxt-modules/strapi development by creating an account on GitHub.
it's even the default
Might be worth trying the good 'old
rm -rf node_modules && rm -rf .nuxt/
@hiimmox, yes I am using the newest version of Nuxt, as well as the newest version of the strapi module.
You can reproduce this error with three lines of batch code. Reported as an issue on GitHub.
https://github.com/nuxt-modules/strapi/issues/440
GitHub
Unsupported version from install example · Issue #440 · nuxt-module...
Version @nuxtjs/strapi: 1.12.0 nuxt: 3.13.0 Reproduction Link https://codesandbox.io/p/devbox/rxycqg Steps to reproduce npx nuxi@latest init versionIssue && cd versionIssue (npm, No) npx nu...
Cool, thats weird. Have you tried without the v5? looks like thats the default anyways
Yes, and it seems that it defaults to v4.
As I said in the initial post, I've inspected the package in my node_modules folder, and there too I only find this:
node_modules/@nuxtjs/strapi/dist/module.d.ts
Oh I see what's up, the v5 support hasn't shipped yet, even though they made the change to the README:
https://github.com/nuxt-modules/strapi/commit/f53bdf9c18123c5c26add33a81f9dab7f598a7ef (this was 2 weeks ago)
Last release was like 6 months ago https://github.com/nuxt-modules/strapi/releases/tag/v1.12.0
Ohh, but why would they update the documentation so well in advance of the actual release? -_-