I’m having trouble importing styles in my Angular 20 app using SCSS.
I tried following the Sass standard:
@use '@swimlane/ngx-datatable';
But this throws an error during build:
✘ [ERROR] Can't find stylesheet to import.
╷
7 │ @use '@swimlane/ngx-datatable';
Apparently, path resolution for @use doesn’t work out of the box. Following advice from Stack Overflow, I changed my imports to:
@use '@swimlane/ngx-datatable/index.css';
@use '@swimlane/ngx-datatable/themes/material.scss';
@use '@swimlane/ngx-datatable/assets/icons.css';
This works when building the app, but fails during unit tests with Karma:
./src/styles.scss - Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Can't find stylesheet to import.
╷
7 │ @use '@swimlane/ngx-datatable/index.css';
Could someone provide a clear explanation of how to correctly import SCSS styles from @swimlane/ngx-datatable in Angular 20 for both build and unit tests?
I’m having trouble importing styles in my Angular 20 app using SCSS.
I tried following the Sass standard:
But this throws an error during build:
Apparently, path resolution for
@usedoesn’t work out of the box. Following advice from Stack Overflow, I changed my imports to:This works when building the app, but fails during unit tests with Karma:
Could someone provide a clear explanation of how to correctly import SCSS styles from
@swimlane/ngx-datatablein Angular 20 for both build and unit tests?