Home > database >  CSS Module parse failed: Unexpected token Angular 14?
CSS Module parse failed: Unexpected token Angular 14?

Time:07-19

After ng build or ng serve I got this error:

./node_modules/ol/ol.css:1:0 - Error: Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> .ol-box {
|   box-sizing: border-box;

I use Angular:

   "@angular/animations": "^14.0.0",
    "@angular/common": "^14.0.0",
    "@angular/compiler": "^14.0.0",
    "@angular/core": "^14.0.0"

CodePudding user response:

Add ol.css path inside angular.json styles array.

angular.json

"styles": ["node_modules/ol/ol.css"]

For More Info

  • Related