vrn-dev / ng6-socket-io

Socket.IO module for Angular 6 and RxjS 6
MIT License
5 stars 11 forks source link

Error "Function calls are not supported in decorators but 'SocketIoModule' was called" #2

Open bkimminich opened 5 years ago

bkimminich commented 5 years ago
ERROR in Error during template compile of 'AppModule'
  Function calls are not supported in decorators but 'SocketIoModule' was called.

When importing and configuring this module as documented the above errors occurs. See https://github.com/bkimminich/juice-shop/blob/gsoc-frontend/frontend/src/app/app.module.ts#L128.

The behavior can be reproduced by

  1. git clone https://github.com/bkimminich/juice-shop
  2. cd juice-shop
  3. git checkout gsoc-frontend
  4. npm install

I did not experience this problem when using e.g. ng-io which is a fork from the same origin repo, but unfortunately without your ngZone.runOutsideAngular fix.

bkimminich commented 5 years ago

A failing build can be found here: https://travis-ci.org/bkimminich/juice-shop/jobs/433126736#L715 The component unit test works fine (https://github.com/bkimminich/juice-shop/blob/gsoc-frontend/frontend/src/app/app.component.spec.ts#L41). Only when doing --aot/--prod builds this error occurs.

Any hint for what might be wrong is appreciated! :sos:

bkimminich commented 5 years ago

A seemingly related issue: https://github.com/angular/angular/issues/23609

zardilior commented 5 years ago

Maybe you can be helped by seeing this example from another library https://github.com/dschnelldavis/angular2-json-schema-form/issues/189