ESM builds of extensions-base and extensions-blob expose only a default export

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
53/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
node.js, typescript, webpack

調査の方向性

Read the ESM webpack configs in azure-functions-nodejs-extensions-base/webpack.config.js and azure-functions-nodejs-extensions-blob/webpack.config.js, then compare them with the servicebus config and inspect ts-loader's module setting. Reproduce the export shape with the Node 22 import command in the issue. Decide how the ESM builds should handle named exports and the existing default import, then verify both package builds expose the intended exports.

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

説明

bug

Found while working on #61.

dist/azure-functions-extensions-base.mjs has no named exports. The ESM webpack config in azure-functions-nodejs-extensions-base/webpack.config.js and azure-functions-nodejs-extensions-blob/webpack.config.js does not override ts-loader's module setting. TypeScript therefore emits CommonJS, and webpack's library: { type: 'module' } only produces export { __webpack_exports__ as default }. The servicebus config already sets compilerOptions: { module: 'esnext' } and is not affected.

Repro (Node 22, base built with npm run build):

node --input-type=module -e "import * as m from 'file:///<repo>/azure-functions-nodejs-extensions-base/dist/azure-functions-extensions-base.mjs'; console.log(Object.keys(m))"
[ 'default' ]

import { ResourceFactoryResolver } from '@azure/functions-extensions-base' fails in Node with does not provide an export named 'ResourceFactoryResolver', and esbuild fails with No matching export.

Fixing it changes the ESM shape. Anyone doing import base from '@azure/functions-extensions-base' today would lose the default export, so the fix should decide whether to keep a default export for compatibility.

主要言語
TypeScript
スター
2
フォーク
8
平均マージ
1時間 6分
マージ済み PR(30日)
3

環境構築

はじめの一歩

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

Azure/azure-functions-nodejs-extensions のほかの issue

Azure/azure-functions-nodejs-extensions の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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