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

Cannot connect through localhost and TypeError: registry.supportFeature is not a function #1

Open
2b2tplayer opened this issue Oct 31, 2022 · 10 comments

Comments

@2b2tplayer
Copy link

from another pc I was unable to connect until I changed "localhost" to "0.0.0.0" and even still it crashes and wont let me join

@Enchoseon
Copy link
Owner

What's your system and the error you're getting?

@2b2tplayer
Copy link
Author

host is archlinux and the pc i use to join is windows, there are no errors in the log/error directory but I cant join the server it creates and when I can it kicks me

@Enchoseon
Copy link
Owner

Other Linux users have reported the same crash you're getting. (example: 2bored2wait Issue #504). I can confirm that the crash is happening on other Arch-based distros as well.

This is something I'm currently looking into. It appears to be caused by either the mcproxy, prismarine-item, or prismarine-registry dependency.

This is also definitely a wake-up call to write better CI tests lol.

@2b2tplayer
Copy link
Author

and on windows 11 server stays on pinging and logging in when I try to join, it gives some error messages in console that I'm trying to get but can't replicate the scenario and seems like they are not being logged into the error folder

@2b2tplayer
Copy link
Author

bUiUXi5Ii6
R2ZGv3Igmx

@N3w001
Copy link

N3w001 commented Nov 3, 2022

Same Issue here Windows 10 Could not connect to server untill i changed "localhost" to 0.0.0.0
Once i did that i get this

C:\Users\ ------ \2based2wait\node_modules\prismarine-item\index.js:51
if (registry.supportFeature('itemSerializationAllowsPresent')) {
^

TypeError: registry.supportFeature is not a function

@Enchoseon
Copy link
Owner

Enchoseon commented Nov 3, 2022

Alright, I found the source of the crash in rob9315/mcproxy. Will update you all whenever a fix gets merged and published.

If you need an immediate fix and don't mind the duct-tape, you can manually edit the file in your ./node_module/ folder as a temporary solution:
1. Open ./node_module/@rob9315/mcproxy/lib/packets.js in a text editor.
2. Delete Line 30 and replace it with const { toNotch: itemToNotch } = require('prismarine-item')(bot.version);


As for the separate networking issue with connecting to localhost, I haven't been able to replicate it yet and would appreciate more info, especially on whether it breaks anything.

@Enchoseon Enchoseon changed the title Not able to connect from other pc or even main pc Cannot connect through localhost and TypeError: registry.supportFeature is not a function Nov 3, 2022
@nickcat325
Copy link

Here are my 2 workarounds. themoonisacheese/2bored2wait#504 (comment)

@Enchoseon
Copy link
Owner

Enchoseon commented Nov 5, 2022

Unfortunately neither of these workarounds apply to this project--for 2based2wait the bug is present in every release, so downgrading doesn't work--and after some more testing I've circled back around to being unsure about the source of the bug again... 😞

In the meantime I've created a new branch with a hotfix: registryCrashHitfix.

@nickcat325
Copy link

@Enchoseon I believe the dependency issue has been fixed. Running yarn install && yarn should resolve this.

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

4 participants