Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

ionic/cli commands in a (react based) monorepo aren't working consistently

Offen
#4,826 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
react, typescript
Bereich
cli, tooling

Rechercherichtung

Beginne damit, die drei gemeldeten Verhaltensweisen aus dem Stammverzeichnis des Nx-Monorepos mit ionic.config.json, der root package.json und apps/myapp/package.json zu reproduzieren. Vergleiche ionic serve/build mit ionic cap-Befehlen und überprüfe, ob das konfigurierte App-Root und das root node_modules konsistent behandelt werden; abgeschlossen ist die Aufgabe, wenn die dokumentierten Befehle vom Stammverzeichnis des Monorepos aus ohne duplizierte Dependencies funktionieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

triage

Description:
ionic cli commands in a (react based) monorepo aren't working consistently.

Steps to Reproduce:
As per instructions, I've defined the ionic.config.json file at the root of my (Nx) monorepo, which has the following structure:

apps/
-- myapp/
dist/
-- apps/
    -- myapp/
libs/
node_modules/
ionic.config.json
package.json

This is ionic.config.json:

{
	"defaultProject": "myapp",
	"projects": {
		"reactr": {
			"name": "myapp",
			"integrations": {
				"capacitor": {}
			},
			"type": "react",
			"root": "apps/myapp"
		}
	}
}

Issues:

  1. ionic cli searches the app root for custom build scripts
    ionic serve doesn't work, as I'm not using react-scripts. Fine.
    I tried adding "ionic:serve": "npm start" to my root package.json to no avail. I had to create apps/myapp/package.json and add the scripts there. Not too bad, but not intuitive and it tooks some trial & error.

  2. ionic cap commands searches the app root for node_modules!
    ionic capacitor is searched in apps/myapp/node_modules/ instead of the root node_modules, so I've had to also add @capacitor/core and @capacitor/cli to apps/myapp/package.json, effectively duplicating these dependencies (in monorepos you want only 1 node_modules usually).

  3. ionic cap open <platform> must be launched in the app root
    While ionic serve/build work from the monorepo root, ionic cap must be launched from the app's root, despite having specified the app's root in ionic.config.json

My ionic info:

Ionic:                                                                          

   Ionic CLI       : 6.19.0 (C:\Users\andre\AppData\Roaming\nvm\v14.18.3\node_modules\@ionic\cli)
   Ionic Framework : @ionic/react 6.0.11 (C:\Users\andre\Code\reac-tr\node_modules\@ionic\react)

Capacitor:
                                                                                
   Capacitor CLI      : 3.4.3
   @capacitor/android : 3.4.3
   @capacitor/core    : 3.4.3
   @capacitor/ios     : 3.4.3

Utility:

   cordova-res : 0.15.4
   native-run  : 1.5.0

System:

   NodeJS : v14.18.3 (C:\Program Files\nodejs\node.exe)
   npm    : 6.14.15
   OS     : Windows 10

Other Information:
Nx monorepo with a react app

Vorherrschende Sprache
TypeScript
Sterne
2k
Forks
681
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus ionic-team/ionic-cli

Alle Issues in ionic-team/ionic-cli

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.