Migration from angled material 5 to angled material 6

0

I'm migrating from angled 5 to 6 and from material 5 to 6. The problem is that the second error occurs when uploading the application.

TypeError: Cannot read property 'appendChild' of null
at MatCommonModule.push../node_modules/@angular/material/esm5/core.es5.js.MatCommonModule._checkThemeIsPresent (core.es5.js:141)
at new MatCommonModule (core.es5.js:93)
at _createClass (core.js:8116)
at _createProviderInstance$1 (core.js:8088)
at initNgModule (core.js:8024)
at new NgModuleRef_ (core.js:8747)
at createNgModuleRef (core.js:8736)
at Object.debugCreateNgModuleRef [as createNgModuleRef] (core.js:10561)
at NgModuleFactory_.push../node_modules/@angular/core/fesm5/core.js.NgModuleFactory_.create (core.js:11263)
at core.js:4161

So far I have not seen any solution to solve the problem.

    
asked by anonymous 18.06.2018 / 16:53

1 answer

0

The workaround for this problem is as follows. In the app.module.ts file inside the providers the following code should be placed:

 {
    provide: MATERIAL_SANITY_CHECKS, 
    useValue: false
 }

This command means that it will not be checked if some material angular theme has been used, so the code will work with external themes without error.

    
22.06.2018 / 18:31