git clone https://github.com/mtlynch/ingredient-demo-frontend.git
cd ingredient-demo-frontend
git checkout syntax-highlight-angular6
npm install
ng serve
ng serve shows two warnings:
WARNING in ./node_modules/ngx-highlight-js/node_modules/@angular/core/fesm5/core.js
4911:15-36 Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/ngx-highlight-js/node_modules/@angular/core/fesm5/core.js
4923:15-102 Critical dependency: the request of a dependency is an expression
This seems to be related to the fact that ngx-highlight-js is installing its own version of angular to node_modules:
$ ls node_modules/ngx-highlight-js/node_modules/
@angular rxjs
If I manually delete the node_modules/ngx-highlight-js/node_modules/@angular directory then the page loads with no errors and applies correct syntax highlighting, but manually deleting from node_modules would obviously be problematic for real deployment scenarios.
ng serve
shows two warnings:When I visit http://localhost:4200/docs, I see
NullInjectorError: No provider for ElementRef!
(full output)This seems to be related to the fact that
ngx-highlight-js
is installing its own version ofangular
tonode_modules
:If I manually delete the
node_modules/ngx-highlight-js/node_modules/@angular
directory then the page loads with no errors and applies correct syntax highlighting, but manually deleting fromnode_modules
would obviously be problematic for real deployment scenarios.