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

Error transpiling some Ember functions

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
babel, javascript
領域
build-system

調査の方向性

ember-cli-babel v2.16.2 と v2.18.0 を使って例で問題を再現し、その後、アロー関数と通常の関数における、インポートされた @ember/debug 関数の Babel 変換を調査します。生成されたコードが a、b、c、d、e のインポートされた warn 参照を ReferenceError なしで保持していれば完了です。

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

説明

Hi, I'm trying to use the new import syntax (@ember/package) but I think I found an issue when using some Ember functions (like Ember.warn).

For example, this piece of code...

import { warn } from '@ember/debug';

const a = () => warn('a');
const b = () => { warn('b') };
const c = () => { return warn('c') };
const d = function(){ warn('d') };
const e = function(){ return warn('e') };

Produces this after building the application:

var a = function a() {
  return warn('a');
};
var b = function b() {
  (true && Ember.warn('b'));
};
var c = function c() {
  return warn('c');
};
var d = function d() {
  (true && Ember.warn('d'));
};
var e = function e() {
  return warn('e');
};

In the example, the functions b and d are correct but the a, c and e are not ok because it will throw a ReferenceError.
For some reason, only the functions that returns something have the wrong code.

Don't know if this is the correct repo to publish this issue but I think it could be related with babel transformations.

I've tested it in my companies application, and an empty projects using v2.16.2 and v2.18.0.

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

環境構築

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

はじめの一歩

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

emberjs/ember-cli-babel のほかの issue

emberjs/ember-cli-babel の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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