DRYな備忘録

Don't Repeat Yourself.

GitHub Actions からの deno deploy が失敗する: Error: The deployment failed: Relative import path "$fresh/server.ts" not prefixed with / or ./ or ../

問題

以下のようにデプロイのGitHub Actionsを設定したが、掲題のエラーを得る。

    steps:
      - name: Clone repository
        uses: actions/checkout@v2
      - name: Upload to Deno Deploy
        uses: denoland/deployctl@v1
        with:
          project: "fresh-youtube"
          entrypoint: "./main.ts"

github.com

原因

解決

    steps:
      - name: Clone repository
        uses: actions/checkout@v2
      - name: Upload to Deno Deploy
        uses: denoland/deployctl@v1
        with:
          project: "fresh-youtube"
          entrypoint: "./main.ts"
+.        import-map: "./import_map.json"

github.com

雑感

  • deno、ノーストレスでTypeScriptが書けるのがよい。
  • あと、dependenciesのimportが直接的かつ明示的なのがよい。
  • 仕事でコード書かないからこそ、いつも触ってない技術をもっと積極的に触っていかなくてはならないと感じた。
  • ということで fresh framework で使えるめちゃくちゃ良い感じのコンポーネント作ったのでぜひStarしてあげてください。

github.com

DRYな備忘録として