aws / aws/aws-lambda-nodejs-runtime-interface-client

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

Aperta
#120 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
224
Fork
60
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.