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

Error on importing the library #233

Open
jaballogian opened this issue Jan 17, 2023 · 3 comments · May be fixed by #234
Open

Error on importing the library #233

jaballogian opened this issue Jan 17, 2023 · 3 comments · May be fixed by #234

Comments

@jaballogian
Copy link

jaballogian commented Jan 17, 2023

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

  • create a React JS app using the npx create-react-app command
  • enter the React Js app and install the @tf2pickup-org/mumble-client dependency by using the npm i @tf2pickup-org/mumble-client command
  • go to the App.js file and add import { Channel, Client } from "@tf2pickup-org/mumble-client";
  • run the React Js app by using the npm start command
  • the error appears

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)

@jaballogian jaballogian changed the title Error on importing the libraries Error on importing the librariy Jan 17, 2023
@jaballogian jaballogian changed the title Error on importing the librariy Error on importing the library Jan 17, 2023
@garrappachc
Copy link
Member

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
Copy link
Author

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
Copy link
Member

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.

@garrappachc garrappachc linked a pull request Jan 18, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants