Skip to content

Troubleshooting

Common issues and solutions when using nuxt-openapi-hyperfetch.

Quick Diagnosis

Generation Issues

Runtime Issues

Performance Issues

Common Problems

1. CLI Command Not Found

bash
nxh: command not found

Solution:

bash
# Install globally
npm install -g nuxt-openapi-hyperfetch

# Or use npx
npx nuxt-openapi-hyperfetch generate -i swagger.yaml

2. Generation Fails

bash
Error: Failed to parse OpenAPI specification

Solution:

  • Validate your OpenAPI spec: Generation Errors
  • Check file path is correct
  • Ensure spec is valid OpenAPI 3.0

3. TypeScript Errors

typescript
Type 'unknown' is not assignable to type 'Pet'

Solution:

4. Composables Not Found

typescript
Cannot find module '~/composables/pets'

Solution:

  • Ensure generation completed successfully
  • Check output directory matches import path
  • Restart Nuxt dev server

5. API Calls Fail

bash
404 Not Found
CORS error

Solution:

  • Configure correct baseURL
  • Check Runtime Errors
  • Verify API endpoint is accessible

By Category

Generation & Build

IssueGuide
OpenAPI parsing errorsGeneration Errors
TypeScript compilation failsType Errors
Build failuresBuild Issues
Slow generationPerformance

Client Composables

IssueGuide
useFetch not workingComposables Issues
Type errors in componentsComposables Issues
Data not reactiveComposables Issues
Callbacks not firingComposables Issues

Server Composables

IssueGuide
H3Event errorsServer Issues
Auth not workingServer Issues
Headers not forwardedServer Issues
Server errorsServer Issues

Runtime

IssueGuide
Network errorsRuntime Errors
CORS issuesRuntime Errors
401/403 errorsRuntime Errors
Timeout errorsRuntime Errors

Getting Help

If you can't find a solution:

  1. Search Issues - Check GitHub Issues
  2. Ask Community - Post in GitHub Discussions
  3. Join Discord - Get help in #support channel
  4. Create Issue - Report bug with reproduction

Creating a Good Bug Report

Include:

markdown
**Environment:**
- OS: Windows 11
- Node: v20.10.0
- nuxt-openapi-hyperfetch: v1.2.0
- Nuxt: v3.10.0

**OpenAPI Spec:**
```yaml
# Minimal spec that reproduces issue

Steps to Reproduce:

  1. Run nxh generate -i spec.yaml
  2. Import generated composable
  3. See error

Expected: Should generate valid composable

Actual: Error: ...

Error Output:


## Debug Mode

Enable verbose logging:

```bash
# Set debug environment variable
DEBUG=nxh:* nxh generate -i swagger.yaml

# Or use verbose flag (if available)
nxh generate -i swagger.yaml --verbose

Next Steps

Choose your issue category:

Released under the Apache-2.0 License.