Imports and requires may not be using Node Loaders/Registration for ESM

オープン
#120 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
28/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
aws, node.js, typescript
領域
backend, cloud

調査の方向性

issue で説明されている AWS SAM index.mjs パスから始め、特に tryRequire と pnp.setup() の呼び出しを試し、その後 -r .pnp.cjs と --loader を使用した場合の挙動を比較します。リンクされている Yarn issue を確認し、CJS と ESM のケースを再現します。完了の条件は、AWS SAM と Yarn PnP の下で imports と requires が連携して動作することです。

索引モデルが issue の本文から書いたものです。

説明

The Yarn PNP mechanism uses loaders and/or registration for CJS and ESM support.

Presently using -r .pnp.cjs works appropriately in AWS SAM but using --loader runs into a host of issues as detailed in:

https://github.com/yarnpkg/berry/issues/6604

I'm not clear why the two are not working together, as they work in other contexts - but in the AWS SAM index.mjs it seems that the tryRequire path goes through a route where pnp.setup(); is unable to monkey patch calls once it is working within the CJS loader by route of the ESM loader.

主要言語
TypeScript
スター
224
フォーク
60
平均マージ
26分
マージ済み PR(30日)
2

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws/aws-lambda-nodejs-runtime-interface-client のほかの issue

aws/aws-lambda-nodejs-runtime-interface-client の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。