Skip to content

Error when building for production #4

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

Closed
danisetg opened this issue Oct 12, 2018 · 9 comments
Closed

Error when building for production #4

danisetg opened this issue Oct 12, 2018 · 9 comments

Comments

@danisetg
Copy link

Hi, I have just installed the module, and it is working fine, but, when trying to build it for production, I am getting this error:
ERROR in 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 expor ted function, resolving symbol Injectable in ... /node_modules/ngx-push-notifications/node_modules/@angular/core/core.d.ts, resolving symbol PushNotificationService in ... /node_modules/ngx-push-notifications/ngx-push-notifications.d.ts, resolving symbol PushNotificationService in D:/work/Front Projects/Enkarga/node_modules/ngx-push-notifications/ngx-push-notifica tions.d.ts
Can anybody help me with this, please

@silveridea
Copy link
Owner

silveridea commented Oct 14, 2018 via email

@sotous
Copy link

sotous commented Oct 17, 2018

Hey guys!, I have problems when build the app for production as well, but my problem is different, check it out:

ERROR in ..\ngx-push-notifications\ngx-push-notifications.ts(19,2): Error during template compile of 'PushNotificationService' Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'Injectable' 'Injectable' calls 'ɵmakeDecorator'.

Your library has been working amazingly and would really like to use it on my project, I would really appreciate any help provided.

@aerodestino
Copy link

I couldn't solve it, I am using angular 6. But for my purpose I found out that there is a Notification Api, very easy to use, and you don't have to install any other module, the Mozilla Notification Api
Ihttps://developer.mozilla.org/en-US/docs/Web/API/notification#Example
I hope it can be of any use for you @sotous

@sotous
Copy link

sotous commented Oct 18, 2018

@aerodestino thank you very much for your suggestion! It saved me a lot of time.

@ShaunCW00
Copy link

Hi @aerodestino love the ease of use of your implementation! but got the same error as mentioned by @sotous when doing ng build --prod:

ERROR in ..\ngx-push-notifications\ngx-push-notifications.ts(19,2): Error during template compile of 'PushNotificationService' Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'Injectable' 'Injectable' calls 'ɵmakeDecorator'.

In my research i found this angular/angular-cli#3854 (comment)

It partially explained the error, I have found that deleting the node modules folder inside of the library show in the picture below allows me to build for production (see picture)

any possibility of updating the build/library to not include this folder

ngx-hack

@danisetg
Copy link
Author

Hi @ShaunCW00 . The Notification api is from Mozilla (https://developer.mozilla.org/en-US/docs/Web/API/notification#Example) and it is added internally to the angular project, so yo don't need the ngx-push-notifications. In that way you can just unninstall ngx-push-notifications, and use Mozilla Notification Api.

@ShaunCW00
Copy link

Great Thanks will have a look at it

@silveridea
Copy link
Owner

Hi @danisetg,
I've upgraded the package to Angular 7. Should work now.

@veneliniliev
Copy link

its not working with Angular 8 :(

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

6 participants