nuxt-modules / nuxt-modules/strapi

How to use "useStrapi4" from /server/api?

Open
#253 9 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
TypeScript
Stars
717
Forks
89
Avg merge
7h 3m
Merged PRs (30d)
6

Description

How can you use Strapi from /server/api/name.post.js?

I get the error [nuxt] [request error] useStrapi4 is not defined if i do not import strapi, and if i try to import useStrapi4 from @nuxtjs/strapi I get the following error [worker reload] [worker init] The requested module 'file://C:/Users/...../node_modules/@nuxtjs/strapi/dist/module.mjs' does not provide an export named 'useStrapi4'.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with /server/api/name.post.js and the @nuxtjs/strapi module export referenced by the error. Check how useStrapi4 is expected to be accessed from a server API entry point, then document the supported usage and verify it no longer produces the reported import error.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxtjs
Domain
api, backend
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.