Skip to content
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

TypeError ​ columnNumber: 1470096 ​ fileName: "http://localhost:4200/main.271bafc3e06f10db73e0.js" ​ lineNumber: 1 ​ message: "l.emit is not a function" #29

Closed
efgiese opened this issue Sep 14, 2018 · 6 comments
Assignees

Comments

@efgiese
Copy link

efgiese commented Sep 14, 2018

Hi,
first of all i want to thank you for your great work!

Now i ran into errors using the ngx-soap.

Running the app in testmode (ng serve) everything is fine. The client is created and i can communicate with the printer (i use it for communication with a soap printer). If i compile my app for production, i ran into errors.
On any communication with the printer i got this error (see header). If i disable "optimization" in angular.json for "build", then i can communicate with the printer and it is working again. I only get some errors about source-maps.
If i disable "buildOptimizer" everything is fine without any errors. Can this be fixed?

I use @angular/cli: 6.1.4 and @angular/core: 6.1.0
See this wsdl:
services.wsdl.xml.txt

PS: Your Demo-App has the same issue!
ng serve --proxy-config proxy.conf.json runs fine
ng serve --proxy-config proxy.conf.json --prod has that error!

@lula
Copy link
Owner

lula commented Sep 14, 2018

Hello @efgiese!

It could be related to this, Build Optimizer does not support es2015 code, I think.

To make short the long story, I wanted the code from node-soap to be changed as little as possible, so I'm afraid some code might not be compliant with angular builder. I might change the code of the client though in order to make it working, but in return I would have more difficulties when the lib needs to be upgraded with a new node-soap version.
That said, I see the main.js bundle of the non-optimized build of demo app larger 10 times more than the optimize build... so I believe it would make sense to make the code compliant with angular build optimization. I'll work on it in the next days. At least, for the time being, there is a workaround.

Anyway, thank you for using this lib and pointing out this issue!

@lula lula self-assigned this Sep 14, 2018
lula added a commit that referenced this issue Sep 14, 2018
@lula
Copy link
Owner

lula commented Sep 14, 2018

The issue is related to Client inheritance of EventEmitter from events lib. I've not digged in deeper, yet.

See commit 9a06f6a

Only four events are emitted: message, xml request, response and error. Response and error, are completely useless as they're already provided in the form of http response/error. I'm wondering whether it might have sense to have these events or not. Should these events be really fundamental or widely used, I would have no choice but the to do the changes. But I really think (hope 😊) they aren't. I cannot find any real use for them: I just wiped them out 😎. For now.

Do you see any possible damage on this approach? What do you think about it?

Thanks!

@efgiese
Copy link
Author

efgiese commented Sep 17, 2018

Hi,
i don' t use the Events, because the Printer don' t use them. I haven' t tested the lib with other wsdl' s, so i can' t say what' s going on with those wsdl' s.

I think, you should try it and see, i' ve it fixes the Problem.

@lula
Copy link
Owner

lula commented Sep 17, 2018

Hello, 0.5.0-beta.7 is out. Just tested with a sample project from scratch: ng serve --prod works as expected. Please let me know if it works for you.

@efgiese
Copy link
Author

efgiese commented Sep 17, 2018

Hi,
thank you very much. For me it' s working...

Bye

@lula
Copy link
Owner

lula commented Sep 17, 2018

Glad to hear it worked. Cheers

@lula lula closed this as completed Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants