0rpc / zerorpc-node

zerorpc for node.js
http://www.zerorpc.io
Other
704 stars 166 forks source link

How to use it with Angular ? #102

Closed johaven closed 5 years ago

johaven commented 5 years ago

I was unable to import zerorpc like this:

import * as zerorpc from 'zerorpc'

or

const zerorpc = require("zerorpc")

When building (with Angular CLI), i got this error:

ERROR in ./node_modules/zeromq/build/Release/zmq.node 1:0
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
borolepratik commented 5 years ago

@johaven you closed this issue, but did you find the solution? Can you post it here please?

johaven commented 5 years ago

@borolepratik Zerorpc (based on ZeroMQ) need an operating system to work, it will never work with a browser (it needs socket or a file to communicate). This library is designed to work with nodejs.

I had not thought about it before posting this issue :)