Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change:
修正, 依存関係の追加
Cause of the Problem (問題の原因)
#247 によって
nanoid
が 4.0.0 になったことで ES Modules の JavaScript ファイルのみが提供されるようになっていました. しかし, TypeScript はこれまで通り CommonJS のファイルを生成するようになっていたため, CommonJS 側から ES Modules の JavaScript をrequire
で読み込もうとしてしまい, はらちょが起動しなくなっていました.Dealing with Problems (問題への対処)
nanoid
のバージョンを差し戻すなどが考えられました. しかしせっかく Node.js も ES Modules に対応しているので, ビルド方式を見直してシステム全体を ES Modules に統一することにしました.Details of implementation (実施内容)
package.json
を ES Modules パッケージのものに書き換えesbuild
を追加debug
スクリプトに--esm
オプションを追加tsc
を型チェックのみに利用するように変更import
パスを, ES Modules の.js
で終わる方式に書き換えAdditional Information (追加情報)
esbuild
に変更したことで, ビルドがあっという間に終わるようになりました. ただし,esbuild
は型検査を行いません.