-
Notifications
You must be signed in to change notification settings - Fork 446
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
Use libp2p-mdns with Electron #880
Comments
Can you add We do not have the type definitions complete in libp2p for some functionalities as you can see per #830 |
@vasco-santos Adding "suppressExcessPropertyErrors": true in tsconfig.json makes the error about the type disappearing. But still got this error: |
@raphael10-collab dgram is a Node.js module for UDP sockets used by https://github.com/mafintosh/multicast-dns/blob/master/index.js#L2 which is a dependency of Any thoughts @hugomrdias ? |
Again either nodeIntegration is enabled for the renderer or you need to run libp2p in the main process. Tip: don't use renderer target in your main webpack config. |
@hugomrdias
This is the ouput: where, I kept, for security reasons, nodeIntegration disabled, and following the indications of @vasco-santos , I set the target as 'web', while running libp2p in the renderer process, : tools/webpack/webpack.renderer.js
and added, temporarily, in tsconfig.json : "suppressExcessPropertyErrors": true
But, once I add MulticastDNS part I get "cannot find module dgram" error |
I found that a previous issue of the same kind was resolved by upgrading node and npm: #91 In my case:
What do I have to do to solve the problem and use the discovery mechanism? |
did you try this?
|
@raphael10-collab could you get this running? |
@vasco-santos Sorry Vasco. I didn't try yet. Since I realized that the available boilerplates or templates for electron-react-typescript-webpack or rely on Electron-Forge, which is full of bugs, or have their own problems, I'm now building, step-by-step, my own boilerplate for electron-react-typescript-webpack. Which is easier to say that to do. |
@raphael10-collab: we're closing this for now, but please reoppen if the issue remains. Thanks! |
Hello friends from years in the past. Apologies for bumping this, but I had a related issue while trying to integrate the multicast-dns package into an application of mine; wherein the @hugomrdias gave a great hint about how to resolve this issue above (sorry for the ping, bom dia my friend), but it didn't encapsulate a full solution--especially not with newer electron/electron-forge builds--so I wanted to quickly explain how I solved this below for anyone like me who may have found themselves here. This can be fixed by enabling Next, you might run into issues with webpack resolving the dgram module, which requires you to assign a different target to the webpack output for the renderer script file (possible target entries can be found here). For me, my webpack config file used the target Hope this helps someone :) |
In an Electron-Typescript-React app when I add this line:
I get this error:
This is the code in src/app/components/App.tsx :
/tools/webpack/webpack.renderer.js :
/tools/webpack/webpack.rules.js :
/tools/webpack/webpack.main.js :
/tools/webpack/webpack.plugins.js :
devDependencies :
dependencies:
If you need to reproduce the error,
I've put the simple repo here: https://github.com/raphael10-collab/Libp2pPlaying
Just git clone it ----> yarn ---> yarn start
The text was updated successfully, but these errors were encountered: