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

Ionic 2 error, "Cannot find module dgram" #31

Open
thomaswb opened this issue May 27, 2017 · 5 comments
Open

Ionic 2 error, "Cannot find module dgram" #31

thomaswb opened this issue May 27, 2017 · 5 comments

Comments

@thomaswb
Copy link

In an Ionic 2 TypeScript project, I've installed the bonjour npm module, then imported it like this:

import bonjour from 'bonjour';

That doesn't throw errors. Bt as soon as I refer to bonjour, I get the runtime error

Cannot find module "dgram"

Has anyone successfully used this plugin with Ionic 2?

@stphnnnn
Copy link

I don't think this is Ionic related. I'm getting the same error with a simple NodeJS project.

@jackie-d
Copy link

jackie-d commented Aug 2, 2017

I'm getting the same error on ionic 2 typescript with bonjour@3.5.0 using

import Bonjour from 'bonjour';
and then

Bonjour.find({ type: 'http' }, function (service) {
        console.log('Found an HTTP server:', service)
      })

@jackie-d
Copy link

jackie-d commented Aug 2, 2017

Found an alternative here at ZeroConf Ionic Plugin, I would have preferred this "bonjour" module but I see no other alternative to go to Zeroconf.

@soundprojects
Copy link

The module dgram is not available in client side Ionic code. Ionic runs on cordova and not on the node js system which means that this package cannot be used in Ionic for the moment. The Zeroconf Ionic plugin is a great alternative, though it is only suited for ios and android.

When programming with the zeroconf plugin, you can use safari to debug when you run on an ios device. Find the 'developer' menu in settings and you can see your device listed there.

When you can't run on a device but in a browser, look up 'mock' to 'imitate' a service being added so you can develop the things you need.

@lbnlrnt
Copy link

lbnlrnt commented Sep 18, 2018

Hi,

I went into the dgram folder and it is pretty empty (just a readme) :

This package name is not currently in use, but was formerly occupied by another package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.

You may adopt this package by contacting support@npmjs.com and requesting the name.

So as suggested I wrote to npm, and they answered :

Thanks for reaching out!

The dgram package on npm was empty and didn't do anything, however many packages mistakenly depended on it. npm, Inc. has taken ownership of it.

It's also a built-in Node module. If you've depended on dgram, you can safely remove it from your package dependencies.

You can learn more about dgram in Node here: https://nodejs.org/api/dgram.html

And so I went to the web site suggested but it doesn't seems it was empty actually....

Whatever, I tried to comment out things with dgram ( in multicast-dns package ) or tweek it but it seems it was useful at some points.

SO, so, i don't know what to do with that haha. I'll go to multicast-dns see what may be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants