Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

v1.6.1: Browser dist entry point is an empty stub, breaking all named exports

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
rollup, typescript
領域
build-system

調査の方向性

まず、package.json のブラウザー向けエクスポートと、dist/browser/index.js および dist/browser/index.d.ts を生成する Rollup のビルド設定を調べます。v1.6.0 と v1.6.1 のアーティファクトを比較し、その後、ブラウザー対応の bundler で失敗を再現します。ブラウザー用ファイルに完全なビルドが含まれ、Jimp や ResizeStrategy などの名前付きインポートが機能すれば完了です。

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

説明

Expected Behavior

dist/browser/index.js should contain the full pre-bundled browser build with all named exports (Jimp, ResizeStrategy, etc.), as it does in v1.6.0.

Current Behavior

In v1.6.1, dist/browser/index.js is a 3-line stub that exports nothing:

export {};
// A stub. The real build is done by rollup.
//# sourceMappingURL=index-browser.mjs.map

Similarly, dist/browser/index.d.ts is:

export {};
//# sourceMappingURL=index-browser.d.mts.map

This causes any bundler that resolves the browser export condition (e.g. Rollup's nodeResolve({ browser: true }), Webpack) to get an empty module. Named imports like import { Jimp, ResizeStrategy } from "jimp" silently resolve to undefined, causing runtime errors.

Failure Information (for bugs)

Steps to Reproduce

  1. Install [email protected] (or jimp@^1.6.0 which resolves to 1.6.1)
  2. Use any bundler that respects the browser export condition in package.json (Rollup with @rollup/plugin-node-resolve({ browser: true }), Webpack, Stencil, etc.)
  3. Import named exports: import { Jimp, ResizeStrategy } from "jimp";
  4. The imports resolve to undefined because the browser entry point is a stub

Comparison:

File v1.6.0 v1.6.1
dist/browser/index.js 727KB, 236 lines, full bundle with exports 98 bytes, stub: export {};
dist/browser/index.d.ts 116KB, 1764 lines of type declarations 55 bytes, stub: export {};
dist/browser/index.js.map 2.9MB 3.0MB (references full build sources)

Note that the sourcemap in 1.6.1 references all the expected source files and is actually larger than the 1.6.0 sourcemap — suggesting the full Rollup build ran but its output was not written to dist/browser/index.js.

The package.json exports field still points to the stub:

".": {
  "browser": {
    "types": "./dist/browser/index.d.ts",
    "default": "./dist/browser/index.js"
  }
}

Context

  • Jimp Version: 1.6.1 (1.6.0 works correctly)
  • Operating System: macOS Darwin 25.3.0
  • Node version: v24.3.0

Failure Logs

jimp__WEBPACK_IMPORTED_MODULE_2__.ResizeStrategy).BILINEAR
              ^-- ResizeStrategy is undefined

Attempted import error: 'Jimp' is not exported from 'jimp' (imported as '$hgUW1$Jimp').

主要言語
TypeScript
スター
14.7k
フォーク
777
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

jimp-dev/jimp のほかの issue

jimp-dev/jimp の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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