How do I get real errors with requirejs?

前端 未结 1 830
北恋
北恋 2021-02-09 19:45

I\'m new to requireJS, and I\'m trying to figure out why I can\'t get normal errors.

I\'m using this, right after the requirejs file is loaded, but before any modules ar

1条回答
  •  天涯浪人
    2021-02-09 20:01

    Remove the "timeout" check. It's keeping you from seeing the modules you're having a problem with unless the problem happens to be a timeout.

    requirejs.onError = function (err) {
        console.log(err.requireType);
        console.log('modules: ' + err.requireModules);
        throw err;
    };
    

    0 讨论(0)
提交回复
热议问题