silveridea / ngx-push-notifications

DEPRECATED - Push notifications for PWA using Service Workers in Angular
20 stars 6 forks source link

Error when building for production #4

Closed danisetg closed 5 years ago

danisetg commented 6 years ago

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 commented 6 years ago

What angular version are you using ?

On Sat, Oct 13, 2018, 04:40 danisetg notifications@github.com wrote:

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/silveridea/ngx-push-notifications/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AIOGpVejvH6tw9YvYHU-t1TjthkWQB2Cks5ukNP3gaJpZM4XZ5qo .

sotous commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

ShaunCW00 commented 5 years ago

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 https://github.com/angular/angular-cli/issues/3854#issuecomment-274344771

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 commented 5 years ago

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 commented 5 years ago

Great Thanks will have a look at it

silveridea commented 5 years ago

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

veneliniliev commented 5 years ago

its not working with Angular 8 :(