angular-cli

Angular prod build error in Cannot assign to a reference or variable

我们两清 提交于 2020-03-18 05:34:35
问题 I can't build prod version of my angular app. And have only this message in IDE console: ERROR in Cannot assign to a reference or variable! So I can build only if add these options: --aot=false --buildOptimizer=false But, even with these options app fails after deploy with this message in browser console: ERROR TypeError: Cannot read property 'init' of undefined which can be fixed by adding one more option: --optimization=false When I try to build with npm run ng build -- --prod I have a log

Angular prod build error in Cannot assign to a reference or variable

浪子不回头ぞ 提交于 2020-03-18 05:34:03
问题 I can't build prod version of my angular app. And have only this message in IDE console: ERROR in Cannot assign to a reference or variable! So I can build only if add these options: --aot=false --buildOptimizer=false But, even with these options app fails after deploy with this message in browser console: ERROR TypeError: Cannot read property 'init' of undefined which can be fixed by adding one more option: --optimization=false When I try to build with npm run ng build -- --prod I have a log

Angular component naming limitations - 'selector [your component name] is invalid'

 ̄綄美尐妖づ 提交于 2020-03-18 03:49:28
问题 In Angular 6 (6.0.7) I'm trying to generate a component via the CLI. I type in ng g c t1-2-3-user and get the error message Selector (app-t1-2-3-user) is invalid. Is there something inherently not allowed in this name? I've already created a parent module called t1-myModule via ng g module t1-myModule and it was created successfully. Within that module is where I'm trying to generate this component. I've tried creating a different name like ng g c t1-testComponent and it works fine - so the

Get Component without spec.ts file in Angularjs 2

隐身守侯 提交于 2020-03-17 05:32:13
问题 Is there a way to get rid of the spec.ts file in Angularjs 2, whenever I create a new component. I know this is for testing purpose but what if I don't need it. May be there is some setting to disable this specific testing file. 回答1: Updated for angular 8 CLI ng generate component --skipTests=true component-name Inside your angular-cli.json set the spec.component parameter to false : { ... "defaults" : { ... "spec": { ... "component": false } } } or use the --spec=false option during creation

Can't install Angular CLI

夙愿已清 提交于 2020-03-05 03:03:13
问题 No matter how many times i tried... i can't install Angular CLI on my computer... I'm using: npm install -g @angular/cli And this is the console error log: C:\Users\Félix Bejarano\AppData\Roaming\npm\ng -> C:\Users\Félix Bejarano\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng npm ERR! path C:\Users\Félix Bejarano\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\fsevents\node_modules npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall lstat npm ERR! Error: EPERM:

Build errors after Upgrading from Angular 8 to 9

こ雲淡風輕ζ 提交于 2020-03-04 21:34:06
问题 I have an Angular application that is hosted in a .net core 3.1 application. I upgraded from 8 to 9 following the official guide and now my application won't build. I get the following errors: "Module not found: Error: Can't resolve '@angular/cdk/layout/breakpoints'", "Field 'browser' doesn't contain a valid alias configuration resolve as module looking for modules in No description file found Field 'browser' doesn't contain a valid alias configuration No description file found no extension

Angular 6 error: CSSSyntaxError - Failed to compile

倾然丶 夕夏残阳落幕 提交于 2020-03-02 10:08:33
问题 Description I am receiving an error for the relative path in the url() that I mention for the 'background' property. When I use an absolute path for it, seems to be working fine. Error Message ERROR in ./src/styles.scss (./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/sass-loader/lib/loader.js??ref--15-3!./src/styles.scss) Module Error (from ./node_modules/postcss-loader/lib/index.js): (Emitted value instead of an instance of Error) CssSyntaxError: /home

ERROR in Illegal State issue when giving angular build

两盒软妹~` 提交于 2020-03-02 08:36:56
问题 I am developing an angular application. It is running without any errors when I run it normally using ng serve . But, when I run ng build --prod , it is giving following error. ERROR in Illegal State: referring to a type without a variable {"filePath":"/Users/admin/Documents/projects/simply-science-web-ui/simply-science/node_modules/@angular/forms/forms.d.ts","name":"NgControlStatusGroup","members":[]} I could not understand what is the issue. Please help me solve this. Please let me know if

ERROR in Illegal State issue when giving angular build

余生颓废 提交于 2020-03-02 08:32:26
问题 I am developing an angular application. It is running without any errors when I run it normally using ng serve . But, when I run ng build --prod , it is giving following error. ERROR in Illegal State: referring to a type without a variable {"filePath":"/Users/admin/Documents/projects/simply-science-web-ui/simply-science/node_modules/@angular/forms/forms.d.ts","name":"NgControlStatusGroup","members":[]} I could not understand what is the issue. Please help me solve this. Please let me know if

What will happen if sourcemap is set as false in Angular

孤者浪人 提交于 2020-02-28 05:53:19
问题 I'm new in Angular. I saw sourcemap in tsconfig.json and by default it is "sourceMap": true . I had few doubts and found this link useful. Still I have the following doubt regarding the same. I set "sourceMap": false , but couldn't find any change in the app. What will be the actual change if I set so? 回答1: Nothing will change in how the app runs. The change will be in your debugging experience. Source maps are helpful for debugging code. You write your code in TypeScript, and the compiler