gBenkyous / inTime

3 stars 0 forks source link

clientコンテナ起動時にエラーが発生する #101

Closed doranko closed 6 hours ago

doranko commented 2 months ago

client コンテナ起動時に eslint および webpack がエラーを吐く

(恐らく node_modules など?)git 管理されていないファイルを削除するとエラーを吐くようになります。 なぜかダッシュボードへのアクセスは可能ですが、エラーなので早急に対応が必要です。

エラーが出ている以上、変更が適用されていない可能性があります(現段階ではそこまではまだ調査していません)。

再現方法

適当なディレクトリに clone してきて dev_v0.0.1 をチェックアウトして docker compose up --build

現状判明していること

コミット: 280d11077c47176b43ff8911a15b370a81273550 (2023/06/17 マージ) 時点で下記のエラーが発生する。 ダッシュボードへのアクセスは可能。

intime-client-1 | [eslint] Failed to load config "react-app" to extend from. intime-client-1 | Referenced from: /usr/src/app/.eslintrc.json intime-client-1 | ERROR in [eslint] Failed to load config "react-app" to extend from. intime-client-1 | Referenced from: /usr/src/app/.eslintrc.json intime-client-1 | intime-client-1 | webpack compiled with 1 error

コミット: 43d611ced2ac7d0c904833dc7ac2f1c99270edd7 (2023/10/23 マージ) 時点で下記のエラーが発生する。

intime-client-1 | Module not found: Error: Can't resolve './RecentOrdersTable.1' in '/usr/src/app/src/content/applications/Transactions' intime-client-1 | ERROR in ./src/content/applications/Transactions/RecentOrders.tsx 5:0-54 intime-client-1 | Module not found: Error: Can't resolve './RecentOrdersTable.1' in '/usr/src/app/src/content/applications/Transactions' intime-client-1 | intime-client-1 | ERROR in [eslint] Plugin "import" was conflicted between ".eslintrc.json" and ".eslintrc.json » eslint-config-react-app". intime-client-1 | intime-client-1 | webpack compiled with 2 errors intime-client-1 | ERROR in src/content/applications/Transactions/RecentOrders.tsx:3:31 intime-client-1 | TS2307: Cannot find module './RecentOrdersTable.1' or its corresponding type declarations. intime-client-1 | 1 | import { Card } from '@mui/material'; intime-client-1 | 2 | import { CryptoOrder } from 'src/models/crypto_order'; intime-client-1 | > 3 | import RecentOrdersTable from './RecentOrdersTable.1'; intime-client-1 | | ^^^^^^^^^^^^^^^^^^^^^^^ intime-client-1 | 4 | import { subDays } from 'date-fns'; intime-client-1 | 5 | intime-client-1 | 6 | function RecentOrders() { intime-client-1 | ERROR in src/content/applications/Transactions/RecentOrders.tsx:3:31 以下略

doranko commented 1 month ago

ERROR in [eslint] Plugin "import" was conflicted between ".eslintrc.json" and ".eslintrc.json » eslint-config-react-app".

eslint の設定のコンフリクトと思われる。 react を使用している関係で package.json にて eslint の設定を読み込んでいるが、それに加えて .eslintrc.json を自前で用意しているのでその設定内容がコンフリクトしているものと想定される。

コンテナ起動後に以下のようなエラーが出るのは単純に eslint によるコーディングルール違反の警告。

ERROR in src/content/applications/Users/profile/ProfileCover.tsx:81:25 TS7031: Binding element 'user' implicitly has an 'any' type.

doranko commented 1 month ago

解決方法はおそらく下記

  1. client/app/.eslint.json を削除
  2. 各 tsx について指摘されている TSxxxx のエラーを修正
gonzaresu-sengoku commented 2 weeks ago

client/app/.eslint.json を削除 ⇒早めにコミットする。  対象ブランチ:dev_v0.0.1

各 tsx について指摘されている TSxxxx のエラーを修正 ⇒各自で修正していく

doranko commented 6 hours ago
  1. client/app/.eslint.json を削除

dev_v0.0.1 にプッシュ済み 各 tsx について各々修正していく