Azure / azure-event-hubs-node

Node client library for Azure Event Hubs https://azure.microsoft.com/services/event-hubs
MIT License
50 stars 44 forks source link

issues with @type/async-lock #81

Closed tdang2 closed 5 years ago

tdang2 commented 6 years ago

Hello,

Context: I am trying to use event-hubs-node within Angular 6 app. The build error I got is

ERROR in node_modules/azure-event-hubs/typings/lib/util/utils.d.ts(1,23): error TS2688: Cannot find type definition file for 'async-lock'.

However, when I tried to to npm install --save @types/async-lock. My build failed with other dependencies such as the following

ERROR in ./node_modules/azure-event-hubs/dist/lib/auth/sas.js
Module not found: Error: Can't resolve 'crypto' in '/Users/dantr001/Documents/Personal/mean-world/node_modules/azure-event-hubs/dist/lib/auth'
ERROR in ./node_modules/adal-node/lib/cache-driver.js
Module not found: Error: Can't resolve 'crypto' in '/Users/dantr001/Documents/Personal/mean-world/node_modules/adal-node/lib'
ERROR in ./node_modules/aws-sign2/index.js
Module not found: Error: Can't resolve 'crypto' in '/Users/dantr001/Documents/Personal/mean-world/node_modules/aws-sign2'
ERROR in ./node_modules/aws4/aws4.js
Module not found: Error: Can't resolve 'crypto' in '/Users/dantr001/Documents/Personal/mean-world/node_modules/aws4'

My current app dependencies are:

"dependencies": {
    "@angular/animations": "^6.0.3",
    "@angular/cdk": "^6.2.1",
    "@angular/common": "^6.0.3",
    "@angular/compiler": "^6.0.3",
    "@angular/core": "^6.0.3",
    "@angular/forms": "^6.0.3",
    "@angular/http": "^6.0.3",
    "@angular/material": "^6.2.1",
    "@angular/platform-browser": "^6.0.3",
    "@angular/platform-browser-dynamic": "^6.0.3",
    "@angular/router": "^6.0.3",
    "azure-event-hubs": "^0.2.2",
    "body-parser": "^1.18.3",
    "core-js": "^2.5.4",
    "dotenv": "^6.0.0",
    "express": "^4.16.3",
    "http-errors": "^1.6.3",
    "mongoose": "^5.1.4",
    "morgan": "^1.9.0",
    "rxjs": "^6.0.0",
    "serve-favicon": "^2.5.0",
    "zone.js": "^0.8.26"
  }`

Please let me know if you need additional information. Thanks!

amarzavery commented 6 years ago

There is a dev dependency on @types/async-lock in the package.json.

This project has not been browserified yet. It works in a node.js environment. Hence there will be unexpected blockers when trying to use it in an angular app.

JB411 commented 6 years ago

Any idea when it will be browserified? Really was wanting to use this in my Angular App as well.

amarzavery commented 6 years ago

Someone has created an eventhub viewer website. It may be interesting for you to take a look. We have a meta issue https://github.com/Azure/azure-event-hubs-node/issues/56 for tracking browser support. We should be able to get it working in the next sprint or two.

AlexGhiondea commented 5 years ago

Closing this in favor of the meta issue.