Fix statically exported pages from hanging (#2930)
Fix statically exported pages from hanging (#2930)

* fix script loading errors not reported if exported

* fix lint

azukaru/next.js,BlancheXu/test,JeromeFitz/next.js,zeit/next.js,flybayer/next.js,BlancheXu/test,azukaru/next.js,flybayer/next.js,JeromeFitz/next.js,azukaru/next.js,zeit/next.js,flybayer/next.js,JeromeFitz/next.js,JeromeFitz/next.js,azukaru/next.js,flybayer/next.js,BlancheXu/test,zeit/next.js