Troubleshooting
ngcc
Build Warnings (Angular >=8.0 && <16.0)
ngcc
Build Warnings (Angular >=8.0 && <16.0)You might get warnings about SlickGrid while doing a production build, most of them are fine and the best way to fix them, is to simply remove/ignore the warnings, all you have to do is to add a file named ngcc.config.js
in your project root (same location as the angular.json
file) with the following content (you can also see this commit which fixes the Angular-Slickgrid-Demos prod build):
Angular 12 with WebPack 5 - how to fix polyfill error
Since Angular 12 switched to WebPack 5, you might get some new errors and you will need to add some polyfills manually to get the Excel Builder (Excel Export) to work.
The error you might get
Steps to fix it
npm install stream-browserify
Add a path mapping in
tsconfig.json
:
Add
stream
(and any other CJS deps) toallowedCommonJsDependencies
in yourangular.json
config:
strictTemplates
error
strictTemplates
errorIn Angular 14 and higher, Angular has a strictTemplates
flag in your tsconfig.json
file (enabled by default when creating new projects from CLI) which causes issues with Angular-Slickgrid events with errors similar to this:
Property 'detail' does not exist on type 'Event'. (onAngularGridCreated)="angularGridReady($event.detail)"
The reason is because Angular-Slickgrid uses Custom Event for all its events and Angular complains because these Custom Events aren't typed. In order to fix this issue, you have 3 viable approaches:
disabled
strictTemplates
in yourtsconfig.json
configcast the event in the View template to
$any
type$any($event)
for example$any($event).detail.eventData
cast the event in the component ViewModel to
CustomEvent
The simplest is obviously the option 1 but you lose the strictness on the view templates, more details can found under the discussion (strictTemplates
) Template error , I have also opened a similar Stack Overflow question myself: How to use Custom Event (not Event Emitter) without strictTemplates
to complain about $event
not being a Custom Event type?.
Last updated