I'm having this problem when I try to use a igx-grid, all other components work fine.
Versions: package.json
Log in browser console:
zone-evergreen.js:797 Uncaught Error: Uncaught (in promise): TypeError: Cannot read property 'detach' of undefinedTypeError: Cannot read property 'detach' of undefined at new igniteui_angular_IgxGridBaseDirective (igniteui-angular.js:53832) at new igniteui_angular_IgxGridComponent (igniteui-angular.js:61347) at createClass (core.js:31985) at createDirectiveInstance (core.js:31807) at createViewNodes (core.js:44210) at callViewAction (core.js:44660) at execComponentViewsAction (core.js:44565) at createViewNodes (core.js:44239) at createRootView (core.js:44082) at callWithDebugContext (core.js:45632) at resolvePromise (zone-evergreen.js:797) at resolvePromise (zone-evergreen.js:754) at zone-evergreen.js:858 at ZoneDelegate.invokeTask (zone-evergreen.js:391) at Object.onInvokeTask (core.js:39680) at ZoneDelegate.invokeTask (zone-evergreen.js:390) at Zone.runTask (zone-evergreen.js:168) at drainMicroTaskQueue (zone-evergreen.js:559)
Hello Miguel,
Thank you for posting in our community.
I have created and attached a small sample trying to reproduce the behavior that you are experiencing. On my side, everything works as expected. There are no errors in the console and igxGrid is displayed properly.
Please test it on your side and let me know how it behaves.You can also try to delete the node_modules folder and run npm install.
If this is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me for further investigation.
Looking forward to hearing from you.
8540.Sample.zip
Hi Martin,
Thank you for you quick response.
Regarding your exemple I had already followed your page exemple and if I open other project the situation doesn't happen.Over the project with the problem I followed your suggestion of deleting the "node_module" folder but the result it's the same.
Is there a way to send you a zip with the project? I'm trying to attach the zip here but keeps giving error.Best regards,
Miguel Domingues
Hi Miguel,
You can upload the sample on cloud storage like google drive, dropbox or any other, and share the link with me.
I am looking forward to hearing from you.
Sorry for the late response.
Here you have a link to the repository with the zip file of the project.
https://github.com/MiguelPetrotec/ShareRepo.git
If you have any kind of problem to obtain it, tell me so and I will create a dropbox to share it with you.
Best regards,
I managed to download your project and run it. I noticed that submodule routing is used. In that case, inside the layout component, the nested router outlet has to be named:
<router-outlet name='sub'></router-outlet>
After this change on my side the igxGrid is displayed. Please test it on your side and let me know how it behaves.
Sorry for the delay again.The problem it's not in the router, I created an example where you can see the error clearly.If possible go to this github repo and download the zip with the project and just access the root of the project you will see a blank screen and in the browser console the error:
EDIT:
For what I could see it seems the cdr (ChangeDetectorRef) is undefined.
Uncaught Error: Uncaught (in promise): TypeError: Cannot read property 'detach' of undefined TypeError: Cannot read property 'detach' of undefined at new igniteui_angular_IgxGridBaseDirective (igniteui-angular.js:53832) at new igniteui_angular_IgxGridComponent (igniteui-angular.js:61347)
GitHub: https://github.com/MiguelPetrotec/ShareRepoFIle: IgniteUi-Angular-base.7zThanks in advance.
I have run your sample from the second link without any modifications(I only installed the node packages) and in the root page, igxGrid renders without the errors you have mentioned.
I have attached a screencast for your reference.
To able to help you I will need a sample that reproduces your issue. If however, the same sample works on my side and not on yours, it could be an issue with your development environment.
I am glad that you find my suggestion helpful.
After further investigation, the issue appears to be related to how the project is built. When JIT compilation is used, in order igxGrid to work, the ES5 standard has to be used. I am currently investigating why exactly this is happening. Note that you can use the AOT compilation with ES2015 standard if you want:
"qual35": { "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.qual35.ts" } ], "optimization": true, "aot": true }
You are the best, problem solved.Just added to each environment the TsConfig entry and the Grids are working.
Can you explain why the other components work perfectly and the Grid is the only that has problems?
I have reproduced your issue and after further investigation, I believe I have found that the root cause for this behavior. When serving the application the default ts.config is used. By adding tsconfig-es5.app.json, in your configuration for qual35 inside the angular.js file, the issue is resolved on my side:
Please test this on your side and let me know if you need any further assistance with this matter.
I now can replicate the problem and you have a way to replicate it also.
Instead of ng serve, please start the application with npm run start35.
Inside package.json :
When I don't change the environment value running the ngserve, all works fine.
Can you please look at it ?
I already tested with a colleague with on a fresh installed environment and it worked.I am doing a full reset on my environment to have the same result.
I am suspecting on having a angular cli 8.2.X and with the 9.0 it works....so maybe cli incompatibility with the most recent igx-grid component or just other kind of incompatiblity between dependencies.
As soon as I solve the problem, I will notify you because this can help other people with similar problem.
Thanks for all the help.