English

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

Thumbnail of post image 189

localStorage への保存や fetch で送る前の JSON.stringify で「Converting circular structure to JSON」と出るのは、オブジェクトが自分自身や親を指しているときです。直 ...

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

Thumbnail of post image 037

自作のクラスや読み込んだライブラリを new で呼んで「is not a constructor」と出るのは、アロー関数や、default export と名前付き export を取り違えて読み込んだ値を new したときです。ブラ ...

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

Thumbnail of post image 038

Vite のビルド(npm run build)が「Could not resolve entry module “index.html”.」や「Cannot resolve entry module inde ...

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

Thumbnail of post image 000

ボタンのクリック処理を onClick=”handleClick()” と文字列で書くと、Expected `onClick` listener to be a function というエラーが出ます。onCl ...

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

Thumbnail of post image 122

hosts ファイルに書いた独自のドメインや、Docker Compose のサービス名のような1語の名前で Vite の開発サーバーを開くと「Blocked request. This host is not allowed」が出ま ...

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

Thumbnail of post image 155

説明文の段落(p)の中にお知らせなどの部品を置くと、React の開発中のコンソールに「In HTML,

cannot be a descendant of

.」と出ます。外側を div にするか、中を span に ...

​​Vite​CSS,トラブルシュート,モノレポ

Thumbnail of post image 048

共通のロゴ画像を親フォルダーに置き CSS の url() で読むと、Vite の開発サーバーが outside of Vite serving allow list と出して 403 を返します。server.fs.allow での ...

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

Thumbnail of post image 184

fetch で取得した JSON を for…of で回したり、分割代入で受けたりスプレッド構文で広げたりして「is not iterable」と出るのは、値がオブジェクトや undefined だったときです。直すと消え ...

​​JavaScript​Chrome DevTools,トラブルシュート

Thumbnail of post image 070

iframe に埋め込んだ別のドメインのページへ postMessage で送ると出る「The target origin provided … does not match the recipient window’s ...

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

Thumbnail of post image 070

文字列リテラル型を1文字ずつ処理する型や、指定した長さのタプル型を作る型で出る TS2589(Type instantiation is excessively deep and possibly infinite.)を、末尾再帰への ...

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

Thumbnail of post image 122

toSorted や findLast を使うと、エディターや npm run build で出る TS2550 を、tsconfig.json の target か lib を変えて直します。lib を書いているときの落とし穴も試し ...

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

Thumbnail of post image 153

Node.js のスクリプトで、関数の外に await を書くと tsc が TS1378 を出すことがあります。tsconfig.json の module を nodenext か esnext に、target を es2017 ...

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

Thumbnail of post image 195

npm install で EUNSUPPORTEDPROTOCOL(Unsupported URL Type “workspace:”)が出るのは、pnpm 用の workspace:* が package. ...

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

Thumbnail of post image 191

Node.js でファイルやログを書き出すストリームで、end() のあとに write() すると出る「write after end」(ERR_STREAM_WRITE_AFTER_END)の原因と直し方です。エラーが出ずに書き込 ...

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

Thumbnail of post image 085

イベントを待つ関数を何度も呼ぶ処理などで、Node.jsの同じイベントにリスナーを11個以上登録すると、MaxListenersExceededWarningが出ます。外し忘れたリスナーを外して警告が消えることと、意図して多く登録する ...

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

Thumbnail of post image 063

git push で「(pre-receive hook declined)」と出るのは、課題番号のないコミットや main への直接の push を、リモート側のフックが断ったためです。remote: の行から理由を読み、コミットを ...

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

Thumbnail of post image 117

リリースのタグ(v1.0.0 など)を git push したときに出る rejected (already exists) は、リモートに同じ名前の別のタグがあるという意味です。エラーを再現し、手元を直す方法とリモートを直す方法を、 ...

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

Thumbnail of post image 061

リリース用のタグ v1.0 と同じ名前のブランチを作ると、Git は warning: refname ‘v1.0’ is ambiguous. を出し、git push は失敗します。ブランチの名前を変えるか ...

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

Thumbnail of post image 189

git switch -c や fetch、push で出る cannot lock ref は、feature と feature/login のようなブランチ名のぶつかりで起きます。エラーを再現し、ブランチ名の変え方と fetch ...

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

Thumbnail of post image 164

プロジェクトの中に別のリポジトリを git clone したあと、git add で出る adding embedded git repository の警告を再現しました。ふつうのファイルとして入れる、submodule にする、. ...

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

Thumbnail of post image 197

React 19 にアップデートしたら画面が真っ白になり、ReactDOM.render is not a function と出るのは、render が削除されたためです。react-dom/client の createRoot ...

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

Thumbnail of post image 198

React のアプリを開くと画面が真っ白で、コンソールに Uncaught Error: Target container is not a DOM element. と出るのは、createRoot に渡した描画先の要素が見つかって ...

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

Thumbnail of post image 006

自作のコンポーネントを書いたのに画面に何も出ず、コンソールに「is unrecognized in this browser」と出るのは、ブラウザーが知らないタグ名の要素を React が作ったときです。4つの原因を再現し、直すと消え ...

​​React​SSR,TypeScript,useEffect,useLayoutEffect,トラブルシュート

Thumbnail of post image 155

React 18のサーバーサイドレンダリング(SSR)で出る「useLayoutEffect does nothing on the server」を再現し、useEffectへの置き換えなどで消えることと、React 19では出ない ...