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

$exports is not defined

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
chart.js, javascript
領域
frontend

調査の方向性

提供されたパッケージバージョンで npm run build を実行して問題を再現し、その後、83 行目付近の chartjs-plugin-deferred.esm.js と cc-chart.js の import を調査します。バンドルされた build で $exports ReferenceError が発生せずに ChartDeferred を import して登録できれば、作業は完了です。

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

説明

I use "npm run build" to get the advantage of the bundle size. In my JS file I imported the ChartDeferred as follows:

import {
  Chart,
  Tooltip,
  Colors,
  BarController,
  CategoryScale,
  LinearScale,
  BarElement,
  Legend,
  BubbleController,
  PointElement,
} from 'chart.js';
import ChartDeferred from 'chartjs-plugin-deferred';

Chart.register(
    Tooltip,
    Colors,
    BarController,
    BarElement,
    CategoryScale,
    LinearScale,
    Legend,
    BubbleController,
    PointElement,
    ChartDeferred,
);

Without the ChartDeferred, the charts are working perfectly, but with ChartDeferred imported, this error appears and I can't get rid of this:

Uncaught ReferenceError: $50e8ddfc489f09fc$exports is not defined
    so chartjs-plugin-deferred.esm.js:83
    beforeInit chartjs-plugin-deferred.esm.js:98
    beforeInit chartjs-plugin-deferred.esm.js:144
    $ helpers.core.ts:109
    _notify core.plugins.js:60
    notify core.plugins.js:42
    notifyPlugins core.controller.js:1148
    _initialize core.controller.js:251
    on core.controller.js:204
    <anonymous> cc-chart.js:42

chart.js = 4.3.0
chartjs-plugin-deferred = 2.0.0

my package.json:

{
  "name": "example",
  "version": "1.0.0",
  "license": "MIT",
  "scripts": {
    "dev": "parcel src/index.html --no-content-hash",
    "build": "parcel build src/index.html --no-content-hash"
  },
  "devDependencies": {
    "parcel": "^2.6.2"
  },
  "dependencies": {
    "@cubejs-client/core": "^0.31.0",
    "chart.js": "^4.0.0",
    "chartjs-plugin-deferred": "^2.0.0"
  }
}
主要言語
JavaScript
スター
113
フォーク
20
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

chartjs/chartjs-plugin-deferred のほかの issue

chartjs/chartjs-plugin-deferred の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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