angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ERROR in Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider rep lacing the function or lambda with a reference to an exported function,

Open chinenyem opened this issue 9 years ago • 8 comments

Bug Report or Feature Request (mark with an x)

when i do ng build i get the following error: getting error ERROR in Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider rep lacing the function or lambda with a reference to an exported function,

- [ ] bug report -> please search issues before submitting
I searched everywhere. The problem was originally ChartModule.forRoot(require('highcharts')). using require was throwing an error. then i read some ticket issues and so a solution. the error went away and the charts worked. but then came another error. 
- [ ] feature request

Versions.

Repro steps.

The log given by the failure.

ERROR in Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider rep lacing the function or lambda with a reference to an exported function, resolving symbol Injectable in /Users/chinenyem/Desktop/learning_sites/ SkyCastWeather/node_modules/angularfire2/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol Injectable in /Users/chinenyem/Deskt op/learning_sites/SkyCastWeather/node_modules/angularfire2/node_modules/@angular/core/src/di.d.ts, resolving symbol Injectable in /Users/chinen yem/Desktop/learning_sites/SkyCastWeather/node_modules/angularfire2/node_modules/@angular/core/src/core.d.ts, resolving symbol Injectable in /U sers/chinenyem/Desktop/learning_sites/SkyCastWeather/node_modules/angularfire2/node_modules/@angular/core/index.d.ts, resolving symbol AngularF ireAuth in /Users/chinenyem/Desktop/learning_sites/SkyCastWeather/node_modules/angularfire2/auth/auth.d.ts, resolving symbol AngularFireAuth in /Users/chinenyem/Desktop/learning_sites/SkyCastWeather/node_modules/angularfire2/auth/auth.d.ts

ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/chinenyem/Desktop/learning_sites/SkyCastWeather/src' @ ./src/main.ts 4:0-74 @ multi ./src/main.ts

Desired functionality.

Mention any other details that might be useful.

chinenyem avatar Apr 05 '17 03:04 chinenyem

app.module.ts flle

`declare var require: any import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { HttpModule, JsonpModule } from '@angular/http'; import {RouterModule, Routes} from '@angular/router'; import { AngularFireModule, AuthProviders, AuthMethods } from 'angularfire2'; import { FirebaseService } from './service/firebase.service'; import { DarkskyService } from './service/darksky.service'; import { FlashMessagesModule } from 'angular2-flash-messages'; import { AgmCoreModule, MapsAPILoader } from "angular2-google-maps/core"; import { MomentModule } from 'angular2-moment'; import { ChartModule } from 'angular2-highcharts'; import { Ng2SearchPipeModule } from 'ng2-search-filter';

import { Ng2FilterPipeModule } from 'ng2-filter-pipe';

const firebaseAuthConfig = { provider: AuthProviders.Google, method: AuthMethods.Popup };

import { AppComponent } from './app.component'; import { HomeComponent } from './component/home/home.component'; import { NavbarComponent } from './component/navbar/navbar.component'; import { WeatherLookupsComponent } from './component/weather-lookups/weather-lookups.component';

const appRoutes: Routes = [ {path:'', component:HomeComponent}, {path:'weather-lookups', component:WeatherLookupsComponent} ]

@NgModule({ declarations: [ AppComponent, HomeComponent, NavbarComponent, WeatherLookupsComponent ], imports: [ AgmCoreModule.forRoot({

  libraries: ["places"]
}),
BrowserModule,
FormsModule,
Ng2SearchPipeModule,
Ng2FilterPipeModule,
MomentModule,
ChartModule.forRoot(require('highcharts')),
HttpModule,
JsonpModule,
ReactiveFormsModule,
FlashMessagesModule,
RouterModule.forRoot(appRoutes),
AngularFireModule.initializeApp(firebaseConfig, firebaseAuthConfig)

], providers: [FirebaseService, DarkskyService], bootstrap: [AppComponent] }) export class AppModule { }`

chinenyem avatar Apr 05 '17 04:04 chinenyem

You are probably having problems with the AoT Code Analysis and the Compiler. You can find an explanation of the limitations concerning AoT here and many more issues describing similar problems on this repo and the official angular repo. A quick workaround might be to disable the aot-mode with --aot false in the cli.

AnianZ avatar Apr 05 '17 08:04 AnianZ

Angularfire2 was throwing the problem . So I uninstall angularfire2 and reinstall it. I also fixed the high charts issue too.

Thank you, it compiles perfectly now with --dev and --prod

On Wed, Apr 5, 2017 at 4:14 AM Anian Z [email protected] wrote:

You are probably having problems with the AoT Code Analysis and the Compiler. You can find an explanation of the limitations concerning AoT here https://gist.github.com/chuckjaz/65dcc2fd5f4f5463e492ed0cb93bca60 and many more issues describing similar problems on this repo https://github.com/angular/angular-cli/issues?utf8=%E2%9C%93&q=is%3Aissue%20ERROR%20in%20Error%20encountered%20resolving%20symbol%20values%20statically.%20function%20calls%20are%20not%20supported and the official angular repo.

A quick workaround might be to disable the aot-mode with --aot false in the cli.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/5833#issuecomment-291787481, or mute the thread https://github.com/notifications/unsubscribe-auth/AH3ThanE2uvUFieHCOYVchFCzEfPXVcmks5rs01NgaJpZM4Mzs3F .

chinenyem avatar Apr 05 '17 14:04 chinenyem

I still have this problem

Bug Report or Feature Request (mark with an x)

When I try to update my code to cli v1. I get errors when i do ng build I tried ng build --aot false, but nothing different

ERROR in Error encountered resolving symbol values statically. Calling function 'ɵmakeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol NgModule in [path...]/ng-cli-v1/node_modules/angular2-prettyjson/node_modules/@angular/core/core.d.ts, resolving symbol PrettyJsonModule in /Users/easonp/Documents/home/_dev/typescript/_labs [path...]/ng-cli-v1/node_modules/angular2-prettyjson/src/prettyjson.module.d.ts, resolving symbol PrettyJsonModule in [path...] /ng-cli-v1/node_modules/angular2-prettyjson/src/prettyjson.module.d.ts

  • [x ] bug report -> please search issues before submitting I searched everywhere. The problem was originally ChartModule.forRoot(require('highcharts')). using require was throwing an error. then i read some ticket issues and so a solution. the error went away and the charts worked. but then came another error.
  • [ ] feature request

Repro steps.

Versions.

npm ERR! Darwin 16.4.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "run" "build" npm ERR! node v6.9.1 npm ERR! npm v3.10.8 npm ERR! code ELIFECYCLE npm ERR! [email protected] build: ng build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] build script 'ng build'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the ng-cli-v1 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ng build npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs ng-cli-v1 npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls ng-cli-v1 npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/easonp/Documents/home/_dev/typescript/_labs/ng-cli-v1/npm-debug.log

my package.json { "name": "ng-cli-v1", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^4.1.0-beta.0", "@angular/common": "^4.1.0-beta.0", "@angular/compiler": "^4.1.0-beta.0", "@angular/compiler-cli": "^4.1.0-beta.0", "@angular/core": "^4.1.0-beta.0", "@angular/flex-layout": "^2.0.0-beta.7", "@angular/forms": "^4.1.0-beta.0", "@angular/http": "^4.1.0-beta.0", "@angular/material": "^2.0.0-beta.2", "@angular/platform-browser": "^4.1.0-beta.0", "@angular/platform-browser-dynamic": "^4.1.0-beta.0", "@angular/platform-server": "^4.1.0-beta.0", "@angular/router": "^4.1.0-beta.0", "@types/dagre": "^0.7.33", "@types/file-saver": "0.0.0", "@types/hammerjs": "^2.0.34", "@types/jszip": "0.0.32", "@types/lodash": "^4.14.61", "angular2-prettyjson": "^2.0.5", "angular2-uuid": "^1.1.1", "bootstrap": "^3.3.7", "core-js": "^2.4.1", "dagre": "^0.7.4", "file-saver": "^1.3.3", "hammerjs": "^2.0.8", "jquery": "^3.2.1", "jszip": "^3.1.3", "ng2-bs3-modal": "^0.10.4", "ng2-completer": "^1.2.2", "rxjs": "^5.1.0", "snapsvg-cjs": "0.0.4", "ts-helpers": "^1.1.2", "zone.js": "^0.8.4" }, "devDependencies": { "@angular/cli": "1.0.0", "@types/snapsvg": "^0.4.26", "@angular/compiler-cli": "^4.0.0", "@types/jasmine": "2.5.38", "@types/node": "~6.0.60", "codelyzer": "~2.0.0", "jasmine-core": "~2.5.2", "jasmine-spec-reporter": "~3.2.0", "karma": "~1.4.1", "karma-chrome-launcher": "~2.0.0", "karma-cli": "~1.0.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "karma-coverage-istanbul-reporter": "^0.2.0", "protractor": "~5.1.0", "ts-node": "~2.0.0", "tslint": "~4.5.0", "typescript": "~2.2.0" } }

EasonPai avatar Apr 06 '17 03:04 EasonPai

Uninstall angular2-prettyjson and then reinstall angular2-prettyjson. The error is being thrown on that module On Wed, Apr 5, 2017 at 11:44 PM Eason Pai [email protected] wrote:

I still have this problem

Bug Report or Feature Request (mark with an x)

When I try to update my code to cli v1. I get errors when i do ng build

I tried ng build --aot false, but nothing different

ERROR in Error encountered resolving symbol values statically. Calling function 'ɵmakeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol NgModule in [path...]/ng-cli-v1/node_modules/angular2-prettyjson/node_modules/@angular/core/core.d.ts, resolving symbol PrettyJsonModule in /Users/easonp/Documents/home/_dev/typescript/_labs [path...]/ng-cli-v1/node_modules/angular2-prettyjson/src/prettyjson.module.d.ts, resolving symbol PrettyJsonModule in [path...] /ng-cli-v1/node_modules/angular2-prettyjson/src/prettyjson.module.d.ts

  • [x ] bug report -> please search issues before submitting

I searched everywhere. The problem was originally ChartModule.forRoot(require('highcharts')). using require was throwing an error. then i read some ticket issues and so a solution. the error went away and the charts worked. but then came another error.

  • feature request

Versions.

Repro steps.

The log given by the failure.

npm ERR! Darwin 16.4.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "run" "build" npm ERR! node v6.9.1 npm ERR! npm v3.10.8 npm ERR! code ELIFECYCLE npm ERR! [email protected] build:ng build`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the [email protected] build script 'ng build'.

npm ERR! Make sure you have the latest version of node.js and npm installed.

npm ERR! If you do, this is most likely a problem with the ng-cli-v1 package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR! ng build

npm ERR! You can get information on how to open an issue for this project with:

npm ERR! npm bugs ng-cli-v1

npm ERR! Or if that isn't available, you can get their info via:

npm ERR! npm owner ls ng-cli-v1

npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:

npm ERR! /Users/easonp/Documents/home/_dev/typescript/_labs/ng-cli-v1/npm-debug.log

`

my package.json

{ "name": "ng-cli-v1", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^4.1.0-beta.0", "@angular/common": "^4.1.0-beta.0", "@angular/compiler": "^4.1.0-beta.0", "@angular/compiler-cli": "^4.1.0-beta.0", "@angular/core": "^4.1.0-beta.0", "@angular/flex-layout": "^2.0.0-beta.7", "@angular/forms": "^4.1.0-beta.0", "@angular/http": "^4.1.0-beta.0", "@angular/material": "^2.0.0-beta.2", "@angular/platform-browser": "^4.1.0-beta.0", "@angular/platform-browser-dynamic": "^4.1.0-beta.0", "@angular/platform-server": "^4.1.0-beta.0", "@angular/router": "^4.1.0-beta.0", "@types/dagre": "^0.7.33", "@types/file-saver": "0.0.0", "@types/hammerjs": "^2.0.34", "@types/jszip": "0.0.32", "@types/lodash": "^4.14.61", "angular2-prettyjson": "^2.0.5", "angular2-uuid": "^1.1.1", "bootstrap": "^3.3.7", "core-js": "^2.4.1", "dagre": "^0.7.4", "file-saver": "^1.3.3", "hammerjs": "^2.0.8", "jquery": "^3.2.1", "jszip": "^3.1.3", "ng2-bs3-modal": "^0.10.4", "ng2-completer": "^1.2.2", "rxjs": "^5.1.0", "snapsvg-cjs": "0.0.4", "ts-helpers": "^1.1.2", "zone.js": "^0.8.4" }, "devDependencies": { "@angular/cli": "1.0.0", "@types/snapsvg": "^0.4.26", "@angular/compiler-cli": "^4.0.0", "@types/jasmine": "2.5.38", "@types/node": "~6.0.60", "codelyzer": "~2.0.0", "jasmine-core": "~2.5.2", "jasmine-spec-reporter": "~3.2.0", "karma": "~1.4.1", "karma-chrome-launcher": "~2.0.0", "karma-cli": "~1.0.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "karma-coverage-istanbul-reporter": "^0.2.0", "protractor": "~5.1.0", "ts-node": "~2.0.0", "tslint": "~4.5.0", "typescript": "~2.2.0" } }

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/5833#issuecomment-292060980, or mute the thread https://github.com/notifications/unsubscribe-auth/AH3ThUfoVYnGuG8siwm9_9uPZ6uVtzxeks5rtF-jgaJpZM4Mzs3F .

chinenyem avatar Apr 06 '17 11:04 chinenyem

@chinenyem thanks for help, I tried to reinstall, but no luck.

But after uninstall angular2-prettyjson, errors are gone, so I think its better to find a alternative package for it.

EasonPai avatar Apr 07 '17 08:04 EasonPai

Closing as it seems sorted, thanks for the help everyone!

filipesilva avatar May 04 '17 13:05 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.