Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#4,826 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
react, typescript
領域
cli, tooling

調査の方向性

まず、ionic.config.json、ルートの package.json、apps/myapp/package.json を使用して、Nx モノレポのルートから報告されている 3 つの動作を再現します。ionic serve/build と ionic cap コマンドを比較し、設定されたアプリのルートとルートの node_modules が一貫して扱われているかを確認します。完了の条件は、重複した依存関係なしで、モノレポのルートからドキュメントに記載されたコマンドが動作することです。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
2k
フォーク
681
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ionic-team/ionic-cli のほかの issue

ionic-team/ionic-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。