herodevs / herodevs-packages

This project is where HeroDevs develops our public npm packages.
55 stars 12 forks source link

hero-loader: Error created and attaching module async #11

Open andchir opened 4 years ago

andchir commented 4 years ago

I use Angular 8.2.3. I follow the example as described here: https://github.com/herodevs/herodevs-packages/tree/master/projects/lazy

When I hover the cursor to element, an error appears:

ERROR Error: Uncaught (in promise): Error created and attaching module async.
    at D (polyfills-es2015.js?4.0.6:1)
    at D (polyfills-es2015.js?4.0.6:1)
    at polyfills-es2015.js?4.0.6:1
    at a.invokeTask (polyfills-es2015.js?4.0.6:1)
    at Object.onInvokeTask (main-es2015.js?4.0.6:1)
    at a.invokeTask (polyfills-es2015.js?4.0.6:1)
    at i.runTask (polyfills-es2015.js?4.0.6:1)
    at y (polyfills-es2015.js?4.0.6:1)

In the developer console, I see that the JS file is loaded successfully.

I tried turning on and off for Ivy, but without result.

andreElrico commented 4 years ago

Everything worked for me as well. However today I have the same error.

EDIT

I could somewhat reproduce this error. After installing:

npm install ngx-tree-data --save

I get warns.

npm WARN ngx-tree-data@0.1.3 requires a peer of @angular/cdk@8.1.2 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-tree-data@0.1.3 requires a peer of @angular/common@8.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-tree-data@0.1.3 requires a peer of @angular/compiler@8.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-tree-data@0.1.3 requires a peer of @angular/core@8.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-tree-data@0.1.3 requires a peer of @angular/forms@8.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-tree-data@0.1.3 requires a peer of @angular/material@8.1.2 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-tree-data@0.1.3 requires a peer of @angular/platform-browser@8.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-tree-data@0.1.3 requires a peer of @angular/platform-browser-dynamic@8.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-tree-data@0.1.3 requires a peer of @angular/router@8.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-tree-data@0.1.3 requires a peer of core-js@2.5.4 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-tree-data@0.1.3 requires a peer of save-dev@2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-tree-data@0.1.3 requires a peer of tslib@1.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

and the module loader does not work anymore.

ERROR Error: Uncaught (in promise): Error created and attaching module async.

STATUS

Cant get it to work despite resolving the PEER dependency warnings,

michaelkrog commented 4 years ago

The error seems to be output if any error occurs when bootstrapping the lazy-loaded module.

Edit The error message comes from here. https://github.com/herodevs/herodevs-packages/blob/master/projects/dynamic-service/src/lib/dynamic-component.service.ts#L113-L117

Any occur that occurs in that try/catch is swallowed and never output.

evanjmg commented 4 years ago

Made a PR - hopefully it will be merged ^

boltex commented 2 years ago

If I may ask respectfully... What's the holdup in merging this pull request?