Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue building with angular-cli 1.0.0 #31

Closed
rustygreen opened this issue Mar 25, 2017 · 16 comments
Closed

Issue building with angular-cli 1.0.0 #31

rustygreen opened this issue Mar 25, 2017 · 16 comments
Labels

Comments

@rustygreen
Copy link

rustygreen commented Mar 25, 2017

After upgrading to the latest Angular and CLI version, I can no longer build the project when "angular2-image-gallery" is include. I created a brand new project with the new angular-cli 1.0.0 and only added the "angular2-image-gallery" module (and dependencies) - per the README instructions (I have a working instance back under angular-cli version 1.0.0-RC1). I now get the following error ANY time I try to build (regardless of whether I am using AOT or not):

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 C:/some-app/node_modules/angular2-image-gallery/node_modules/@angular/core/src/metadata/ng_module.d.ts, resolving symbol NgModule in C:/some-app/node_modules/angular2-image-gallery/node_modules/@angular/core/src/metadata.d.ts, resolving symbol
NgModule in C:/some-app/node_modules/angular2-image-gallery/node_modules/@angular/core/src/core.d.ts, resolving symbol NgModule in C:/some-app/node_modules/angular2-image-gallery/node_modules/@angular/core/index.d.ts, resolv
ing symbol Angular2ImageGalleryModule in C:/some-app/node_modules/angular2-image-gallery/app/angular2imagegallery.module.ts, resolving symbol Angular2ImageGalleryModule in C:/some-app/node_modules/angular2-image-gallery/app/
angular2imagegallery.module.ts

Environment:
OS: Windows 10
Node: 6.9.1
Angular CLI: 1.0.0

Any thoughts? This seems related: angular/angular-cli#3707

I'll post the code if needed. Thanks!

@born2net
Copy link

I have the same issue, can't use ng-cli 1.0 due to this bug.

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 Injectable in C:/msweb/studioweb/node_modules/ng-mslib/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol Injectable in C:/msweb/studioweb/node_modules/ng-mslib/node_modules/@angular/core/src/di.d.ts, resolving symbol Injectable in C:/msweb/studioweb/node_modules/ng-mslib/node_modules/@angular/core/src/core.d.ts, resolving symbol Injectable in C:/msweb/studioweb/node_modules/ng-mslib/node_modules/@angular/core/index.d.ts, resolving symbol NgmslibService in C:/msweb/studioweb/node_modules/ng-mslib/dist/services/ngmslib.service.d.ts, resolving symbol NgmslibService in C:/msweb/studioweb/node_modules/ng-mslib/dist/services/ngmslib.service.d.ts

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './locale/app/app-module.ngfactory' in 'C:\msweb\studioweb\src'
 @ ./src/main.ts 6:0-71
 @ multi ./src/main.ts

worked fine in release rc.1

@born2net
Copy link

@rustygreen still having the same issue?

@rustygreen
Copy link
Author

@born2net, yes I am. I have not found a fix yet.

@born2net
Copy link

@rustygreen Rob helped out, I had to change in my package.json lib dependencies to peerDependencies and fixed the issue.

@aldo-roman
Copy link

aldo-roman commented Mar 25, 2017

Hi @born2net can you specify how your package.json file ended?

Mine is

"dependencies": {
},
"devDependencies": {
  "@angular/common": "^4.0.0",
  "@angular/compiler-cli": "^4.0.0",
  "@angular/compiler": "^4.0.0",
  "@angular/core": "^4.0.0",
  "@angular/forms": "^4.0.0",
  "@angular/platform-browser": "^4.0.0",
  "reflect-metadata": "^0.1.10",
  "rxjs": "^5.2.0",
  "zone.js": "^0.8.5",
  "@types/core-js": "^0.9.39",
  "typescript": "^2.2.1"
},
"peerDependencies": {
  "@angular/common": "^4.0.0",
  "@angular/compiler-cli": "^4.0.0",
  "@angular/compiler": "^4.0.0",
  "@angular/core": "^4.0.0",
  "@angular/forms": "^4.0.0",
  "@angular/platform-browser": "^4.0.0"
}

but still reproduce the error

@born2net
Copy link

born2net commented Mar 25, 2017

see here:
https://github.com/born2net/ng-mslib/blob/master/package.json
this is a lib that is USED BY an angular project!

@BenjaminBrandmeier
Copy link
Owner

Thanks for your support guys. I moved the angular dependencies to peerDependencies for now and published a new version of angular2-image-gallery to NPM (0.6.2).
However, if you'd like to use the gallery with Angular-Cli 1.0.0 there are two things to consider:

  1. Import BrowserAnimationsModule in your project:
  imports: [
    Angular2ImageGalleryModule,
    BrowserAnimationsModule, <---- add this to your project
    BrowserModule,
    FormsModule,
    HttpModule,
  ],
  1. IE 11 currently not working
    I only had a quick look at this and it didn't get pass the Loading... screen. I'm planning on having a clean migration to Angular 4 and take care about browser compatibility as soon as I find some free time somewhen. But I'm also happy to accept PRs as you know.

If there are any different issues with the new version regarding angular-cli 1.0.0 please raise a new issue for this. I will close this one for now.

@bfan1256
Copy link

bfan1256 commented Mar 30, 2017

I'm still receiving the same error as @rustygreen even after your 0.6.2 update.
package.json:

    ...
    "dependencies": {
        "@angular/animations": "^4.0.0",
        "@angular/common": "^4.0.0",
        "@angular/compiler": "^4.0.0",
        "@angular/compiler-cli": "^4.0.0",
        "@angular/core": "^4.0.0",
        "@angular/forms": "^4.0.0",
        "@angular/http": "^4.0.0",
        "@angular/platform-browser": "^4.0.0",
        "@angular/platform-browser-dynamic": "^4.0.0",
        "@angular/platform-server": "^4.0.0",
        "@angular/router": "^4.0.0",
        "angular2-image-gallery": "^0.6.2",
        "hammerjs": "^2.0.8",
        "typescript": "^2.2.1",
        "web-animations-js": "^2.2.2",
        "zone.js": "^0.6.23"
    },
    "devDependencies": {
        "@angular/cli": "^1.0.0",
        "@types/hammerjs": "^2.0.33",
        "@types/jasmine": "2.5.38",
        "@types/node": "^6.0.42",
        "codelyzer": "~2.0.0-beta.1",
        "jasmine-core": "2.5.2",
        "jasmine-spec-reporter": "2.5.0",
        "karma": "1.2.0",
        "karma-chrome-launcher": "^2.0.0",
        "karma-cli": "^1.0.1",
        "karma-jasmine": "^1.0.2",
        "karma-remap-istanbul": "^0.2.1",
        "protractor": "4.0.9",
        "ts-node": "1.2.1",
        "tslint": "^4.0.2",
        "typescript": "~2.0.3",
        "webdriver-manager": "10.2.5"
    }
}

Error is here:

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 e
xported function, resolving symbol Injectable in D:/.../node_modules/angular2-image-gallery/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol OpaqueToken in D:/.../node_modules/angular2-image-gallery/node_modules/@angular/core/src/di/opaque_token.d.ts, resolving symbol OpaqueToken in D:/.../node_modules/angular2-image-gallery/node_
modules/@angular/core/src/di/opaque_token.d.ts
(...) are just placeholder values for actual file path

@BenjaminBrandmeier
Copy link
Owner

It seems like we've to do some work for being AOT-compatible:
https://github.com/rangle/angular-2-aot-sandbox

If anyone finds and/or removes the remaining issues in the code or knows of an easy way to find the 'not-aot-compatible' lines of code, please contribute. :)

Otherwise I will have a look at this as soon as I'll find some free time.

@bfan1256
Copy link

bfan1256 commented Apr 5, 2017

I got the entire thing to work by downloading your source code and adding it to my folder structure and then importing each into the app module and declaring/providing the component/service.

@BenjaminBrandmeier
Copy link
Owner

Interesting, so we have a dirty workaround. ;)

So it could also be related to my whacky approach to create the library...

However, this issue remains and we need to fix it.

@BenjaminBrandmeier
Copy link
Owner

BenjaminBrandmeier commented Apr 10, 2017

Alright, folks. I changed the library creation process to use the NGC rather than the TSC compiler. With the new approach even AOT and the angular-cli 1.0.0 integration shouldn't be an issue anymore.

Could one of you retry with the newly published angular2-image-gallery 0.7.0 version?

@BenjaminBrandmeier
Copy link
Owner

Update for ng build --prod included in 0.7.1.

Would love to hear feedback regarding this issue. Could somebody test it? Otherwise I'll close this issue.

@stepanic
Copy link

I have issue with v0.7.4

$ ng --version
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.0.0
node: 6.10.0
os: darwin x64
@angular/animations: 4.0.2
@angular/common: 4.0.2
@angular/compiler: 4.0.2
@angular/core: 4.0.2
@angular/flex-layout: 2.0.0-beta.7
@angular/forms: 4.0.2
@angular/http: 4.0.2
@angular/platform-browser: 4.0.2
@angular/platform-browser-dynamic: 4.0.2
@angular/router: 4.0.2
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.2
@angular/compiler-cli: 4.0.2

$ ng serve
** NG Live Development Server is running on http://localhost:4200 **
Hash: 3ae9f186dbc714358bca
Time: 15372ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 531 kB {4} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 108 kB {3} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 10.3 kB {4} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.11 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

ERROR in Error encountered resolving symbol values statically. Calling function 'ɵmakeDecorator', function calls are not supported. Consider replacing the fu
nction or lambda with a reference to an exported function, resolving symbol NgModule in /Users/matijastepanic/git/inzrak/web/node_modules/angular2-image-gall
ery/node_modules/@angular/core/core.d.ts, resolving symbol Angular2ImageGalleryModule in /Users/matijastepanic/git/inzrak/web/node_modules/angular2-image-gal
lery/angular2imagegallery.module.d.ts, resolving symbol Angular2ImageGalleryModule in /Users/matijastepanic/git/inzrak/web/node_modules/angular2-image-galler
y/angular2imagegallery.module.d.ts
webpack: Failed to compile.

@stepanic
Copy link

stepanic commented Apr 20, 2017

@BenjaminBrandmeier ignore my last comment because when I execute this:

rm -rf node_modules
npm install

Then all errors are gone :D

This module is fantastic Photo Gallery, good job!

@BenjaminBrandmeier
Copy link
Owner

@stepanic Thanks for the feedback. :)
I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants