English

​​Lighthouse​HTML,トラブルシュート

Thumbnail of post image 065

Lighthouse で「Page lacks the HTML doctype」と出たときの直し方です。1行目に を書けば消え、ページが後方互換モード(quirks mode)で表示されるのを防げます。古い doctype で出る ...

​​Lighthouse​HTML,アクセシビリティ,トラブルシュート

Thumbnail of post image 173

Lighthouse で、スマホのピンチ操作による拡大を禁止していると指摘されたときの直し方です。meta viewport の user-scalable=no と maximum-scale を外すと合格します。どの値で落ちるか、 ...

​​Playwright​E2Eテスト,TypeScript,トラブルシュート

Thumbnail of post image 039

Playwright の E2E テストで、閉じたメニューのリンクや hidden の input を waitFor() で待つと「waiting for locator to be visible」のまま止まります。Call lo ...

​​Playwright​E2Eテスト,TypeScript,Vite,トラブルシュート

Thumbnail of post image 079

Playwright の E2E テストで page.goto が net::ERR_CONNECTION_REFUSED で失敗するのは、開く URL のポートでサーバーが動いていないためです。開発サーバーを先に起動する、webSe ...

​​Vite​Linux,トラブルシュート

Thumbnail of post image 161

strictPort を付けた Vite の開発サーバーで出る「Port 5173 is already in use」と、HMR のポートがぶつかったときのエラーの直し方です。別のプロジェクトの開発サーバーを止めるか、ポートを分ける ...

​​JavaScript​トラブルシュート

Thumbnail of post image 190

ページ送り(ページネーション)の番号を new Array で作るとき、入力欄を空にしたりマイナスを入れたりすると「RangeError: Invalid array length」が出ます。長さを計算する前に入力を調べると消えること ...

​​TypeScript​トラブルシュート

Thumbnail of post image 186

設定や引数のオブジェクトで、読み取り専用のプロパティに代入すると出る TS2540 を、コピーを作る、readonly を外す、setter を足すなどで直します。as const や Object.freeze でも試しました。

​​JavaScript​Chromium,Node.js,トラブルシュート

Thumbnail of post image 071

JavaScript で BigInt と普通の数値を足したり割ったりして出る「TypeError: Cannot mix BigInt and other types」を起こし、片方の型にそろえると消えることを確かめました。処理時間 ...

​​TypeScript​トラブルシュート

Thumbnail of post image 010

API のレスポンスの型や document のメソッドで、プロパティの名前を打ち間違えると出る TS2551 を起こし、候補の名前に直すと消えることを確かめました。型の定義のほうが間違っているときの直し方も試しました。

​​TypeScript​ES Modules,Node.js,トラブルシュート

Thumbnail of post image 063

自分で書いたファイルや npm のパッケージから import { … } で読み込むと、tsc に TS2305 が出ることがあります。相手がその名前を export していないのが原因で、export を足すか名前を直すと消えまし ...

​​npm​Node.js,npm workspaces,トラブルシュート

Thumbnail of post image 066

モノレポで npm run や npm install に –workspace を付けたら「npm error No workspaces found」で止まったときの直し方です。フォルダ名ではなく package.js ...

​​Node.js​JavaScript,トラブルシュート

Thumbnail of post image 032

Node.js の http.request で出る「Error: socket hang up」は、応答が返る前に接続が切れたというエラーです。API サーバーが落ちた状況を再現し、fetch での見え方と、サーバーを直すとエラーが ...

​​Node.js​JavaScript,npm,トラブルシュート

Thumbnail of post image 011

Node.js の readFile で設定ファイルを読もうとして出る「ENOENT: no such file or directory」を起こし、相対パスが実行した場所から探されていたことと、import.meta.url を基準 ...

​​npm​Node.js,トラブルシュート

Thumbnail of post image 031

npm ls が「npm error code ELSPROBLEMS」で終了コード1になり、CI が止まったときの直し方です。missing(足りない)と invalid(版が合わない)の読み方と、npm install で消えるこ ...

​​Git​コマンドライン,トラブルシュート

Thumbnail of post image 036

git add や git commit で「Unable to create ‘…/.git/index.lock’: File exists.」と出たら、動いている Git がないことを確かめてから ind ...

​​Git​コマンドライン,トラブルシュート

Thumbnail of post image 122

git pull や git merge で You have not concluded your merge と出るのは、前のマージの競合を直したあと、コミットせずに次へ進んだときです。git commit で終えるか git m ...

​​Git​コマンドライン,トラブルシュート

Thumbnail of post image 125

git push で ‘origin’ does not appear to be a git repository と出るのは、origin というリモートがないときです。GitHub などへ初めて push ...

​​Git​コマンドライン,トラブルシュート

Thumbnail of post image 085

作業が終わったブランチを git branch -d で消そうとして not fully merged と出るのは、Git が見ている相手にまだ取り込まれていないコミットがあるときです。マージしたつもりでも止まる3つの場合を再現し、そ ...

​​Git​コマンドライン,トラブルシュート

Thumbnail of post image 156

マージ後に要らなくなったブランチを git branch -d で消そうとして cannot delete branch と出るのは、そのブランチがどこかで使われているときです。worktree や rebase の途中などの場合ごと ...

​​React​Next.js,TypeScript,Vite,トラブルシュート

Thumbnail of post image 089

API からデータを取得して表示するコンポーネントを async にすると、React 19 では「… is an async Client Component」というエラーが出ます。Vite では useEffect か use に ...

​​React​JavaScript,TypeScript,Vite,トラブルシュート

Thumbnail of post image 068

React で合計金額や平均を表示すると、画面に NaN と出て、Received NaN for the children attribute の警告が出ることがあります。NaN になる原因の見つけ方と、初期値や条件分岐で直す方法を ...

​​React​TypeScript,Vite,トラブルシュート

Thumbnail of post image 083

ツールチップのような、子の要素にイベントを足す部品を使ったときに「React.Children.only expected to receive a single React element child」と出るのは、children ...

​​React​CSS,TypeScript,Vite,トラブルシュート

Thumbnail of post image 067

HTML や SVG のマークアップを JSX に写したとき、style=”color: red” のままだと The style prop expects a mapping のエラーで画面が真っ白になります ...

​​React​HTML,TypeScript,Vite,トラブルシュート

Thumbnail of post image 137

プルダウン(セレクトボックス)で初めに選んでおく項目を決めようと、Reactでoptionにselectedを付けると、コンソールに警告が出ます。selectのdefaultValueかvalueに値を渡す書き方に直すと消えることを、 ...