2based2wait icon indicating copy to clipboard operation
2based2wait copied to clipboard

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

Open itsmaybetokyo opened this issue 3 years ago • 10 comments

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

itsmaybetokyo avatar Oct 31 '22 18:10 itsmaybetokyo

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

Enchoseon avatar Oct 31 '22 21:10 Enchoseon

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

itsmaybetokyo avatar Oct 31 '22 21:10 itsmaybetokyo

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.

Enchoseon avatar Oct 31 '22 21:10 Enchoseon

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

itsmaybetokyo avatar Oct 31 '22 21:10 itsmaybetokyo

bUiUXi5Ii6 R2ZGv3Igmx

itsmaybetokyo avatar Oct 31 '22 21:10 itsmaybetokyo

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

N3w001 avatar Nov 03 '22 01:11 N3w001

~~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 avatar Nov 03 '22 03:11 Enchoseon

Here are my 2 workarounds. https://github.com/themoonisacheese/2bored2wait/issues/504#issuecomment-1304312198

nickcat1 avatar Nov 04 '22 22:11 nickcat1

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... :disappointed:

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

Enchoseon avatar Nov 05 '22 21:11 Enchoseon

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

nickcat1 avatar Nov 06 '22 19:11 nickcat1