arielfaur / ionic-audio

An audio player for Ionic 3 and Angular 4. Works with HTML 5 audio or native audio using Cordova Media plugin.
http://arielfaur.github.io/ionic-audio/2.0/index.html
MIT License
321 stars 163 forks source link

Ionic --prod error #121

Closed napcat closed 7 years ago

napcat commented 7 years ago

When trying to build in production mode passing the flag --prod the build gets an error.

[18:31:57]  ionic-app-script task: "build"
[18:31:57]  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
            D:/_GIT/AppProject/node_modules/ionic-audio/node_modules/@angular/core/core.d.ts, resolving symbol ɵf in
            D:/_GIT/AppProject/node_modules/ionic-audio/node_modules/@angular/core/core.d.ts, resolving symbol ɵf in
            D:/_GIT/AppProject/node_modules/ionic-audio/node_modules/@angular/core/core.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 export
ed function, resolving symbol Injectable in D:/_GIT/AppProject/node_modules/ionic-audio/node_modules/@angular/core/core.d.ts, resolving symbol ɵf in D:/_GIT/AppProject/node_modules/ionic-audio/no
de_modules/@angular/core/core.d.ts, resolving symbol ɵf in D:/_GIT/AppProject/node_modules/ionic-audio/node_modules/@angular/core/core.d.ts
    at Error (native)
    at syntaxError (D:\_GIT\AppProject\node_modules\@angular\compiler\bundles\compiler.umd.js:1550:34)
    at simplifyInContext (D:\_GIT\AppProject\node_modules\@angular\compiler\bundles\compiler.umd.js:23870:23)
    at StaticReflector.simplify (D:\_GIT\AppProject\node_modules\@angular\compiler\bundles\compiler.umd.js:23882:13)
    at StaticReflector.annotations (D:\_GIT\AppProject\node_modules\@angular\compiler\bundles\compiler.umd.js:23331:41)
    at NgModuleResolver.resolve (D:\_GIT\AppProject\node_modules\@angular\compiler\bundles\compiler.umd.js:13883:70)
    at CompileMetadataResolver.getNgModuleMetadata (D:\_GIT\AppProject\node_modules\@angular\compiler\bundles\compiler.umd.js:14473:60)
    at addNgModule (D:\_GIT\AppProject\node_modules\@angular\compiler\bundles\compiler.umd.js:23050:58)
    at D:\_GIT\AppProject\node_modules\@angular\compiler\bundles\compiler.umd.js:23061:14
    at Array.forEach (native)

Does the component needs to update it's dependencies?

How can I fix this error?

anilkumar007 commented 7 years ago

Did you solved the above issue?

napcat commented 7 years ago

Hello!

No the problem is still there... can't build with my current dependencies.

Build scripts 1.3.7, ionic 3.0 and angular 4.

arielfaur commented 7 years ago

@napcat I see this error now after upgrading to Angular 4.1.2. Creating a module for Ionic and Angular is hard work because of the maintenance. Every release breaks something. I have changed the module quite a few times already to fix AOT related errors. I searched briefly and couldn't find any documentation related to that build error. Maybe someone can shed some light.

stefanheule commented 7 years ago

I did some investigation, and I believe I found the fix, see pull request https://github.com/arielfaur/ionic-audio/pull/127.

napcat commented 7 years ago

Can that be merged in 3.0 version and we get an updated version?

sfaizanh commented 7 years ago

@napcat can you check node_modules/ionic-audio/ contain node_modules directory, if exists then delete that and build with --prod flag.

Every time you install package there will be node_modules in ionic-audio folder so you have to remove it until @arielfaur fixed that, @arielfaur you can fix that by moving dependencies to devDependencies https://github.com/arielfaur/ionic-audio/pull/102/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R14 my last PR contains the fixes of this issue

arielfaur commented 7 years ago

@sfaizanh I have been pulling my hair trying to make AOT work. It simply does not compile with -prod. I have already moved dependencies to devDependencies as you suggested. Could you please take a look at the code I pushed to the 3.0 branch? I may have overlooked something. The code compiles and works fine with a normal build. Try to run a npm run build --prod inside the demo project folder. You obviously need to npm install first 😄 You will see the demo project has a reference to ionic-audio in the parent folder for development purposes. Thanks!

arielfaur commented 7 years ago

127

sfaizanh commented 7 years ago

Sure I'll look into it, give me hour or two

Sent from my iPhone

On Jun 7, 2017, at 23:19, arielfaur notifications@github.com wrote:

127

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.