Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Nuxt Generator fails with npm; pinia requires extra config

Abierto
#367 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Documentación
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
nuxt

Línea de trabajo

Comienza con la documentación del generador de Nuxt y la sección del README enlazada en el issue, y después vuelve a ejecutar el comando de npm para confirmar la limitación. Revisa la guía de instalación de Nuxt, las instrucciones de package.json y el ejemplo de nuxt.config.ts; se considera terminado cuando la documentación explique el uso de yarn e incluya los pasos necesarios de configuración de npm y Pinia.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

API Platform version(s) affected: 3.0.9

Description

Following the steps for the Nuxt generator at https://api-platform.com/docs/create-client/nuxt/ failed. Specifically:

  • I was unable to use npm to create the nuxt client - I had to use yarn (which worked). I assumed that based on the README I should be able to use npm.
  • Installing pinia requires additional steps. Opening the Nuxt site and navigating to my resource showed this error in browser: getActivePinia was called with no active Pinia. Did you forget to install pinia? const pinia = createPinia() app.use(pinia) This will fail in production.

How to reproduce: npm failure

When attempting to use the Nuxt generator with npm:

npm create @api-platform/client https://demo.api-platform.com . --generator nuxt --resource foo

it failed with the following output:

Usage: create-client entrypoint outputDirectory

Generate apps built with Next, Nuxt, Quasar, React, React Native, Vue or Vuetify for any API documented using Hydra or OpenAPI

Options:
  -V, --version                                 output the version number
  -r, --resource [resourceName]                 Generate CRUD for the given resource
  -p, --hydra-prefix [hydraPrefix]              The hydra prefix used by the API (default: "hydra:")
  --username [username]                         Username for basic auth (Hydra only)
  --password [password]                         Password for basic auth (Hydra only)
  --bearer [bearer]                             Token for bearer auth (Hydra only)
  -g, --generator [generator]                   The generator to use, one of "next", "nuxt", "quasar", "react", "react-native", "typescript", "vue", "vuetify" or a path to a
                                                custom generator of your choice (default: "next")
  -t, --template-directory [templateDirectory]  The templates directory base to use. Final directory will be ${templateDirectory}/${generator} (default:
                                                "/Users/rs/.npm/_npx/eeb701ba6cc95913/node_modules/@api-platform/create-client/lib/../templates/")
  -f, --format [hydra|openapi3|openapi2]        "hydra", "openapi3" or "openapi2" (default: "hydra")
  -s, --server-path [serverPath]                Path to express server file to allow route dynamic addition (Next.js generator only)
  -h, --help                                    display help for command

Documentation should be added to say that the Nuxt generator can only be used with yarn.

How to reproduce: pinia installation failure

Installation instructions are only given using yarn. I assumed they would also work with npm but that's not the case. The steps at https://pinia.vuejs.org/ssr/nuxt.html should be followed for npm, which requires adding an overrides to package.json as well as explicitly installing the pinia module.

How to reproduce: pinia failure when opening the Nuxt site in a browser

As per https://pinia.vuejs.org/ssr/nuxt.html

    modules: [
        '@pinia/nuxt',
    ],

should be added to nuxt.config.ts

Lenguaje dominante
TypeScript
Estrellas
376
Forks
132
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de api-platform/create-client

Todos los issues de api-platform/create-client

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.