ionic-frameworkvisual-studio-codeionic4

How To Fix This Error [Error: Failed to find '@ionic/angular/css/display.css']


When i run the operation ionic serve it fails to compile and gives an error code that says:

ERROR in ./src/global.scss (./node_modules/@angular-devkit/build- 
angular/src/angular-cli-files/plugins/raw-css- 
loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/
sass-loader/lib/loader.js??ref--14-3!./src/global.scss)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Failed to find '@ionic/angular/css/display.css'
in [
C:project/src
]
at resolveModule.catch.catch (project\node_modules\postcss- 
import\lib\resolve-id.js:35:13)

This is a piece of code i tried to integrate into my own project which opens the camera to take a picture and you can either upload the picture or delete it. I tried searching for "@ionic/angular/css/display.css" on the internet but couldn't find a solution. I started ionic just recently so i don't understand much about it.

If anyone wants to see the code It is here The original i took it from had the code at home.page.ts but i needed it at tab1.page.ts so the error may be born from this. Also global.scss


Solution

  • The method i used to solve the problem is importing "@ionic/angular/css/display.css". I did it manually taking it from a project where it exists and copying it to the Project which gives the error.