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

Production build fails after upgrading to ionic 2.1.0 #236

Closed
vbolshutkin opened this issue Mar 10, 2017 · 11 comments
Closed

Production build fails after upgrading to ionic 2.1.0 #236

vbolshutkin opened this issue Mar 10, 2017 · 11 comments

Comments

@vbolshutkin
Copy link

In clean working copy cloned from master branch with re-installed npm dependencies running ionic build browser --prod fails with the following error:

[19:01:01]  ngc started ... 
[19:01:02]  build prod failed: Error encountered resolving symbol values statically. Calling function 
            'NoOpAnimationDriver', function calls are not supported. Consider replacing the function or lambda with a 
            reference to an exported function, resolving symbol AnimationDriver.NOOP in 
            /home/user/devel/clicker/node_modules/@angular/platform-browser/src/dom/animation_driver.d.ts,
            resolving symbol BrowserTestingModule in 
            /home/user/devel/clicker/node_modules/@angular/platform-browser/testing/browser.d.ts, 
            resolving symbol BrowserTestingModule in 
            /home/user/devel/clicker/node_modules/@angular/platform-browser/testing/browser.d.ts 
[19:01:02]  ionic-app-script task: "build" 
[19:01:02]  Error: Error encountered resolving symbol values statically. Calling function 'NoOpAnimationDriver', 
            function calls are not supported. Consider replacing the function or lambda with a reference to an exported 
            function, resolving symbol AnimationDriver.NOOP in 
            /home/user/devel/clicker/node_modules/@angular/platform-browser/src/dom/animation_driver.d.ts,
            resolving symbol BrowserTestingModule in 
            /home/user/devel/clicker/node_modules/@angular/platform-browser/testing/browser.d.ts, 
            resolving symbol BrowserTestingModule in 
            /home/user/devel/clicker/node_modules/@angular/platform-browser/testing/browser.d.ts 
Error: Error encountered resolving symbol values statically. Calling function 'NoOpAnimationDriver', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AnimationDriver.NOOP in /home/user/devel/clicker/node_modules/@angular/platform-browser/src/dom/animation_driver.d.ts, resolving symbol BrowserTestingModule in /home/user/devel/clicker/node_modules/@angular/platform-browser/testing/browser.d.ts, resolving symbol BrowserTestingModule in /home/user/devel/clicker/node_modules/@angular/platform-browser/testing/browser.d.ts
    at simplifyInContext (/home/user/devel/clicker/node_modules/@angular/compiler/bundles/compiler.umd.js:25703:25)
    at StaticReflector.simplify (/home/user/devel/clicker/node_modules/@angular/compiler/bundles/compiler.umd.js:25715:15)
    at StaticReflector.annotations (/home/user/devel/clicker/node_modules/@angular/compiler/bundles/compiler.umd.js:25213:62)
    at NgModuleResolver.resolve (/home/user/devel/clicker/node_modules/@angular/compiler/bundles/compiler.umd.js:17573:84)
    at CompileMetadataResolver.getNgModuleMetadata (/home/user/devel/clicker/node_modules/@angular/compiler/bundles/compiler.umd.js:18081:62)
    at CompileMetadataResolver.getNgModuleSummary (/home/user/devel/clicker/node_modules/@angular/compiler/bundles/compiler.umd.js:18037:54)
    at /home/user/devel/clicker/node_modules/@angular/compiler/bundles/compiler.umd.js:18127:70
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (/home/user/devel/clicker/node_modules/@angular/compiler/bundles/compiler.umd.js:18122:51)
    at addNgModule (/home/user/devel/clicker/node_modules/@angular/compiler/bundles/compiler.umd.js:24975:60)

Before upgrading to ionic 2.1.0 (commit 13a6cd6) it worked well.

@lathonez
Copy link
Owner

lathonez commented Mar 11, 2017 via email

@lathonez
Copy link
Owner

replicated

@lathonez
Copy link
Owner

confirmed that downgrading to angular 2.2.1 fixes (this specific problem) - not a solution

@lathonez
Copy link
Owner

@lathonez
Copy link
Owner

Straight upgrade of Ionic to angular2.4 on a starter project does not give the error, suggesting something from the testing framework must be the root cause (as suggested above)

@saschwarz
Copy link

saschwarz commented Mar 14, 2017

I fixed this in my project by adding the following to: tsconfig.json:

"exclude": [
"src/test.ts",
"node_modules",
"**/*.spec.ts"
],

See also: ionic-team/ionic-app-scripts#806

@lathonez
Copy link
Owner

@saschwarz thanks - confirmed working here, needed both test.ts and *.spec.ts. There was a reason we didn't do this..

@lathonez
Copy link
Owner

lathonez commented Mar 14, 2017

Reason: #174 (comment)

Excluding spec makes the testing imports go missing in the editor. I do hate the fact that when I change code (and my tests break), ionic serve stops working though.

Maybe exlcuding spec from the main tsconfig.json is the lesser of two evils?

Also presumably there's a way of configuring one's editor outside of the project's tsconfig.json

@lathonez
Copy link
Owner

above should sort it, added some tests for the browser build into CI as a quick win.

TODO - update blog if this is legit

@kamok
Copy link

kamok commented Apr 18, 2017

This issue came up again after upgrading to Ionic 3. The cause is a d.ts file related to @ionic/cloud-angular which I had installed previously to test out their service. After removing it, rolling back all the steps here: https://docs.ionic.io/setup.html, I was able to build again. I don't know why excluding node_modules in ts.config.json doesn't work. But that was where the file was.

@lathonez
Copy link
Owner

Not happening here or on travis:

https://s3.amazonaws.com/archive.travis-ci.org/jobs/220910203/log.txt

I've never used cloud-angular so I guess isolated to that.

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

No branches or pull requests

4 participants