microsoft / microsoft/TypeScript

Dynamic import breaks global onError with requirejs

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

@rbuckton がすでに取り組んでいます。

2019年6月26日 から。

Needs Investigation
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

TypeScript Version: 3.2.2

Search Terms: dynamic import, requirejs, amd, onerror

Code

import('module').then(()=>{ /* some code*/ });

compiled to

new Promise(function (resolve_1, reject_1) {
   require(['module'], resolve_1, reject_1);
});

If require are called with 3 arguments then require.onError is not fired. Reject should be adeed only in case when we have a catch call after import.

Some propose:

//@ts-import-no-reject
import('module').then(()=>{ /* some code*/ });
new Promise(function (resolve_1) {
   require(['module'], resolve_1);
});

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

評価

この issue はまだ評価されていません。

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

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