📕
Angular-Slickgrid
Live DemoGitHub
  • Introduction
  • Getting Started
    • Quick start
    • Troubleshooting
  • Styling
    • Dark Mode
    • Styling CSS/SASS/Themes
  • Column Functionalities
    • Cell Menu (Action Menu)
    • Editors
      • Autocomplete
      • Date Picker (vanilla-calendar)
      • LongText (textarea)
      • Select Dropdown Editor (single/multiple)
    • Filters
      • Autocomplete
      • Input Filter (default)
      • Select Filter (dropdown)
      • Compound Filters
      • Range Filters
      • Custom Filter
      • Styling Filled Filters
      • Single Search Filter
    • Formatters
    • Sorting
  • Events
    • Available events
    • On Events
  • Slick Grid/DataView Objects
    • Slick Grid/DataView Objects
  • Grid Functionalities
    • Auto-Resize / Resizer Service
    • Resize by Cell Content
    • Column Picker
    • Composite Editor Modal
    • Custom Tooltip
    • Add, Update or Highlight a Datagrid Item
    • Dynamically Add CSS Classes to Item Rows
    • Column & Row Spanning
    • Context Menu
    • Custom Footer
    • Excel Copy Buffer Plugin
    • Export to Excel
    • Export to File (csv/txt)
    • Grid Menu
    • Grid State & Presets
    • Grouping & Aggregators
    • Header & Footer Slots
    • Header Menu & Header Buttons
    • Infinite Scroll
    • Pinning (frozen) of Columns/Rows
    • Providing data to the grid
    • Row Detail
    • Row Selection
    • Tree Data Grid
    • Row Based Editing Plugin
    • FAQ
  • Developer Guides
    • CSP Compliance
  • Localization
    • with Custom Locales
    • with ngx-translate
      • Component Sample
  • Backend Services
    • Custom Backend Service
    • OData
    • GraphQL
      • JSON Result Structure
      • Filtering Schema
      • Pagination Schema
      • Sorting Schema
  • Testing
    • Testing Patterns
  • Migrations
    • Migration Guide to 2.x (2018-06-23)
    • Migration Guide to 3.x (2021-07-20)
    • Migration Guide to 4.x (2021-12-11)
    • Migration Guide to 5.x (2022-10-17)
    • Migration Guide to 6.x (2023-05-29)
    • Migration Guide to 7.x (2023-12-15)
    • Migration Guide to 8.x (2024-05-23)
    • Migration Guide to 9.x (2025-05-10)
Powered by GitBook
On this page
  • ngcc Build Warnings (Angular >=8.0 && <16.0)
  • Angular 12 with WebPack 5 - how to fix polyfill error
  • The error you might get
  • Steps to fix it
  • strictTemplates error
Edit on GitHub
  1. Getting Started

Troubleshooting

PreviousQuick startNextDark Mode

Last updated 26 days ago

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 which fixes the Angular-Slickgrid-Demos prod build):

module.exports = {
  packages: {
    'angular-slickgrid': {
      ignorableDeepImportMatchers: [
        /assign-deep/,
        /dequal/,
        /slickgrid\//,
        /flatpickr/,
      ]
    },
  }
};

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

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

Steps to fix it

  1. npm install stream-browserify

  2. Add a path mapping in tsconfig.json:

{
  ...
  "compilerOptions": {
    "paths": {
      "stream": [ "./node_modules/stream-browserify" ]
    },
  }
}
  1. Add stream (and any other CJS deps) to allowedCommonJsDependencies in your angular.json config:

"options": {
  "allowedCommonJsDependencies": [
    "stream"
  ],
},

strictTemplates error

In 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:

  1. disabled strictTemplates in your tsconfig.json config

  2. cast the event in the View template to $any type

    • $any($event) for example $any($event).detail.eventData

  3. cast the event in the component ViewModel to CustomEvent

<angular-slickgrid gridId="grid28"
    [columns]="columnDefinitions"
    [options]="gridOptions"
    [dataset]="dataset"
    (onAngularGridCreated)="angularGridReady($event.detail)">
</angular-slickgrid>
angularGridReady(event: CustomEvent<AngularGridInstance>) {
  this.angularGrid = event.detail;
  this.gridObj = this.angularGrid.slickGrid;
}

The simplest is obviously the option 1 but you lose the strictness on the view templates, more details can found under the discussion , I have also opened a similar Stack Overflow question myself:.

commit
(strictTemplates) Template error
How to use Custom Event (not Event Emitter) without strictTemplates to complain about $event not being a Custom Event type?