tf2pickup-org / mumble-client

A simple mumble client for managing mumble servers
MIT License
5 stars 3 forks source link

Error on importing the library #233

Open jaballogian opened 1 year ago

jaballogian commented 1 year ago

Description

Error after importing the Channel or Client object from this library as seen in the screenshot below image

Compiled with problems:X

ERROR in ./node_modules/@tf2pickup-org/mumble-client/dist/client.js 22:13-26

Module not found: Error: Can't resolve 'os' in 'D:\A.ing\Works\Others\Lacak-and-Valid\Exercises\React-Js\learn-mumble-client\node_modules\@tf2pickup-org\mumble-client\dist'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
    - add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
    - install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
    resolve.fallback: { "os": false }

ERROR in ./node_modules/@tf2pickup-org/mumble-client/dist/tls-connect.js 12:30-44

Module not found: Error: Can't resolve 'tls' in 'D:\A.ing\Works\Others\Lacak-and-Valid\Exercises\React-Js\learn-mumble-client\node_modules\@tf2pickup-org\mumble-client\dist'

Steps to produce

Environment

Framework: React Js 18.2.0 OS: Windows 11 and Monterey 12 (tested with both) Node: Node: 14.21.2, 16.18.0, and 18.13.0 (switchable)

garrappachc commented 1 year ago

Problematic line - you're trying to use mumble-client in the browser, and the os module exists only in node.js environment. I'll have it fixed.

jaballogian commented 1 year ago

Problematic line - you're trying to use mumble-client in the browser, and the os module exists only in node.js environment. I'll have it fixed.

You're right. That's why there is no UI/frontend/HTML file on this repository.

I thought this library could be used on the frontend side because there was a "client" name on the repository title ("mumble-client").

garrappachc commented 1 year ago

Problematic line - you're trying to use mumble-client in the browser, and the os module exists only in node.js environment. I'll have it fixed.

You're right. That's why there is no UI/frontend/HTML file on this repository.

I thought this library could be used on the frontend side because there was a "client" name on the repository title ("mumble-client").

It is a mumble client, as in it connects to a remote mumble server. It was intented to run on Node.JS environment primarily (my use-case), but there is no reason why it couldn't run in the browser as well.