I recently started updating my code from Angular 16 to the latest version, which is Angular 18.
Below is the snippet of code I've implemented, but it's causing compilation errors:
@use '@angular/material' as mat;
// Define custom palettes for NAPSA colors
$napsa-blue: (
// color codes here
);
$napsa-orange: (
// color codes here
);
// More code snippets follow...
I keep encountering this error:
Undefined function.
╷
72 │ $light-primary: mat.define-palette($napsa-blue);
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
src/napsa.scss 72:17 root stylesheet
./src/napsa.scss?ngGlobalStyle - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Undefined function.
╷
71 │ $light-primary: mat.define-palette($napsa-blue);
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
src/napsa.scss 71:17 root stylesheet
** The Angular Live Development Server can be accessed at localhost:4200. Visit http://localhost:4200/ in your browser. **
✖ Compilation failed.