Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Build prod failed: Error encountered resolving symbol values statically #823

Closed
MathieuNls opened this issue Mar 17, 2017 · 3 comments
Closed

Comments

@MathieuNls
Copy link

Short description of the problem:

Prod build fail (iOS & Android). Serve and dev are ok.

What behavior are you expecting?

Steps to reproduce:

  1. git clone https://github.com/Toolwatchapp/tw-mobile
  2. npm install
  3. ionic build ios --prod
[10:23:56]  build prod failed: 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 
            /Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/tw-core/node_modules/@angular/core/src/di/metadata.d.ts,
            resolving symbol OpaqueToken in 
            /Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/tw-core/node_modules/@angular/core/src/di/opaque_token.d.ts,
            resolving symbol OpaqueToken in 
            /Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/tw-core/node_modules/@angular/core/src/di/opaque_token.d.ts
[10:23:56]  ionic-app-script task: "build" 
[10:23:56]  Error: 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 
            /Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/tw-core/node_modules/@angular/core/src/di/metadata.d.ts,
            resolving symbol OpaqueToken in 
            /Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/tw-core/node_modules/@angular/core/src/di/opaque_token.d.ts,
            resolving symbol OpaqueToken in 
            /Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/tw-core/node_modules/@angular/core/src/di/opaque_token.d.ts
Error: 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 /Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/tw-core/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol OpaqueToken in /Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/tw-core/node_modules/@angular/core/src/di/opaque_token.d.ts, resolving symbol OpaqueToken in /Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/tw-core/node_modules/@angular/core/src/di/opaque_token.d.ts
    at SyntaxError.BaseError [as constructor] (/Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/@angular/compiler/bundles/compiler.umd.js:1597:31)
    at new SyntaxError (/Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/@angular/compiler/bundles/compiler.umd.js:1795:20)
    at simplifyInContext (/Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/@angular/compiler/bundles/compiler.umd.js:25783:27)
    at StaticReflector.simplify (/Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/@angular/compiler/bundles/compiler.umd.js:25795:17)
    at StaticReflector.annotations (/Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/@angular/compiler/bundles/compiler.umd.js:25291:64)
    at NgModuleResolver.resolve (/Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/@angular/compiler/bundles/compiler.umd.js:17771:86)
    at CompileMetadataResolver.getNgModuleMetadata (/Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/@angular/compiler/bundles/compiler.umd.js:18272:64)
    at addNgModule (/Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/@angular/compiler/bundles/compiler.umd.js:25053:62)
    at /Users/mathosx/Desktop/toolwatch/tw-mobile/node_modules/@angular/compiler/bundles/compiler.umd.js:25064:18
    at Array.forEach (native)

Which @ionic/app-scripts version are you using?

1.1.4

@MathieuNls
Copy link
Author

Was caused by npm/npm#10343

@trakhimenok
Copy link

@MathieuNls can I ask how did you solve this? I'm getting the same error for browser build and can't figure out how to fix it.

@MathieuNls
Copy link
Author

@astec , I changed the way I bundle my lib (https://github.com/Toolwatchapp/tw-core) by using webpack. Then, the main product (https://github.com/Toolwatchapp/tw-mobile) imports this already optimised bundle.

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

No branches or pull requests

2 participants