I have created an ionic app and it has stopped compiling successfully first time.
First Time i compile it I get an error : "localhost/:1 Refused to load the image 'http://localhost:8100/favicon.ico' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback. localhost/:1 Failed to load resource: the server responded with a status of 404 (Not Found)" ,and the screen shows 'Cannot GET'. The error was as follows:
When I make a change to my code and recompile the code (comment out a random line of code)This is the error I get: "Uncaught Error: Unexpected module 'LoginPageModule' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation.
And I get a white screen.
When a undo the changes I have just done(i.e uncomment the random line I had previously commented). Recompile it the app finally compiles successfully.
tsconfig.json:
{"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": { "fullTemplateTypeCheck": true, "strictInjectionParameters": true } }