libp2p / js-libp2p-webrtc-star

libp2p WebRTC transport that includes a discovery mechanism provided by the signalling-star
https://libp2p.io
Other
320 stars 97 forks source link

__dirname is not defined #409

Closed Xendergo closed 2 years ago

Xendergo commented 2 years ago

Description:

When I run the signalling server and visit the address it's hosted on, I get a 500 error in the browser, and the server logs:

Debug: internal, implementation, error 
    ReferenceError: __dirname is not defined
    at handler (file:///usr/local/lib/node_modules/@libp2p/webrtc-star-signalling-server/dist/src/index.js:34:59)
    at exports.Manager.execute (/usr/local/lib/node_modules/@libp2p/webrtc-star-signalling-server/node_modules/@hapi/hapi/lib/toolkit.js:57:29)
    at Object.internals.handler (/usr/local/lib/node_modules/@libp2p/webrtc-star-signalling-server/node_modules/@hapi/hapi/lib/handler.js:46:48)
    at exports.execute (/usr/local/lib/node_modules/@libp2p/webrtc-star-signalling-server/node_modules/@hapi/hapi/lib/handler.js:31:36)
    at Request._lifecycle (/usr/local/lib/node_modules/@libp2p/webrtc-star-signalling-server/node_modules/@hapi/hapi/lib/request.js:371:68)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Request._execute (/usr/local/lib/node_modules/@libp2p/webrtc-star-signalling-server/node_modules/@hapi/hapi/lib/request.js:281:9)

How to reproduce:

Pull the container: docker pull libp2p/js-libp2p-webrtc-star

Run the container: docker run -p 9090:9090 libp2p/js-libp2p-webrtc-star

Go to localhost:9090

toorop commented 2 years ago

Note that even if the index.html cannot be displayed, the signaling process works as expected throught websocket.

mateuszjarzewski commented 2 years ago

Can we have this fixed? This project works nowhere, all examples how to run it fails with error 500.

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version @libp2p/webrtc-star-signalling-server-v1.0.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket: