我正在尝试导入一个导出Promise的模块:
System.import('./details.js').then(details => {
console.log(details.default); // returns a pending Promise
details.default.then(m => {
console.log(m); // never executes, I expect to see 'whatever' here
})
});
我尝试导入的模块:
export default Promise
.all([
System.import('./dateHelper'),
System.import('charts'),
])
.then(mods => Promise.all(mods.map(mod => mod.default)))
.then(([dateHelper, charts]) => {
/* ...module content... */
return 'whatever';
});
我是否在导出模块时犯了错误,导致永无止境的Promise?