Nuxt Generator fails with npm; pinia requires extra config
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- nuxt
- Ambito
- documentation
Direzione di ricerca
Inizia dalla documentazione del generatore Nuxt e dalla sezione del README collegata nell’issue, quindi riproduci il comando npm per confermare la limitazione. Controlla le istruzioni per l’installazione di Nuxt, le istruzioni per package.json e l’esempio di nuxt.config.ts; il lavoro è completato quando la documentazione spiega l’utilizzo di yarn e include i passaggi di configurazione richiesti per npm e Pinia.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
npmto 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
- Lingua principale
- TypeScript
- Stelle
- 376
- Fork
- 132
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di api-platform/create-client
-
[potential Security Alert] New `test-vue-app` script added in `@api-platform/client-generator@0.8.0` Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
api-platform/create-client#396 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
api-platform/create-client#397 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
api-platform/create-client#395 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
api-platform/create-client#394 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
api-platform/create-client#393 · 1 commento ·
Tutte le issue di api-platform/create-client
Issue simili
-
blocklist removal
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
pastelsky/bundlephobia#1122 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100