Skip to content

Nuxt Generator with -f openapi3 options is not working with 500 error code. #365

Open

Description

@LazyGeniusMan

API Platform version(s) affected: x.y.z

Description

Nuxt Generator with -f openapi3 options is not working with 500 error code.
The error message is:

Cannot read properties of null (reading 'hydra:member')

at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async setup (C:\Users\LazyGeniusMan\git\nuxt-openapi\components\book\BookList.js:35:18)

How to reproduce

Follow step on https://api-platform.com/docs/create-client/nuxt/ but using -f openapi3 option and add docs.json to url.

Possible Solution

Additional Context

image

I also tried different OpenAPI 3 specs from Swagger's Pet Store 3, it still gave me the same error. I also tried Quasar generator with OpenAPI 3 specs and it's working fine.

A bit out of topic of this bug, I have some questions:

  1. How to overwrite the generated files ? I can't find a way to do that.
  2. Does some kind of "Headless" generator is possible/on the scope of this project so that UI components/pages is not generated?

Activity

  1. cloudmaker97 commented on Jun 1, 2024

    @cloudmaker97

    I can reproduce the same issue on my system with API-Platform 3.3

    I've used this command:
    pnpm create @api-platform/client http://sw-partly.ddev.site/api/docs.jsonopenapi . -f openapi3 --generator nuxt

    The output of the command was:

    Code for the "VehicleManufacturer" resource type has been generated!
    Code for the "VehiclePartCondition" resource type has been generated!
    Code for the "VehiclePart" resource type has been generated!
    Code for the "Vehicle" resource type has been generated!

    It recognizes all available API-Platform Endpoints, but when I try to access the generated page, i get this error:

    Cannot read properties of null (reading 'hydra:member')
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async setup (./components/vehiclemanufacturer/VehicleManufacturerList.js:49:18)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions