[Fixed] Unable to apply theme in angular ag grid in angular 10

Issue

I am using Angular 10 in my project with ag-grid-community 25.1 version. Up on running the application with the ag-theme-alphine.css I get the below error.

Error: Failed to find '../node_modules/ag-grid-community/dist/styles/ag-theme-alpine.css'
  in [
    /Users/ranjith/workspace/my-project/src/app/pages/headercard/components/programs-header
  ]

styles.scss

@import "../node_modules/ag-grid-community/dist/styles/ag-grid.scss";
@import "../node_modules/ag-grid-community/dist/styles/ag-theme-alpine.css";

I am sure that I have this file in the node_modules directory.
Note: I am using scss in my project.

Solution

You can check your sass folder in your theme. I have encountered a similar issue and fixed it using the below scss file

@import "../node_modules/ag-grid-community/dist/styles/ag-theme-alpine/sass/ag-theme-alpine";

Leave a Reply

(*) Required, Your email will not be published