## 事象 [[paths (tsconfig)|paths]]を以下のように設定する。 ```ts { "compilerOptions": { "paths": { "~/": ["./"], "~": ["."] } } } ``` 以下のような構成 ```  . ├──  biome.json ├──  biome.json.tmp ├──  bun.lock ├──  bunfig.toml ├──  index.ts ├──  libs.ts ├──  node_modules ├──  package.json └──  tsconfig.json ``` `index.ts` で `lib.ts` のメソッドを以下のようにインポートしようとしても、`sum` が解決しない。 ```ts import { sum } from "~/libs"; sum(); ``` ### 環境 | 対象 | バージョン | | -------------- | ----- | | [[TypeScript]] | 5.9.3 | ## 原因 [[paths (tsconfig)|paths]]の書き方が違うから。 ## 解決方法 以下のように `*` をつけて書く。 ```ts { "compilerOptions": { "paths": { "~/*": ["./*"], } } } ```