Windows game freezes when entering the world

woozie

Newcomer
The game freezes when I try to join my friend's server with mods, could someone help me please, the error is:

[SMAPI] An error occurred in the overridden update loop: InvalidOperationException: Operation is not valid due to the current state of the object.
at Netcode.NetRefTypes.ReadGenericType(BinaryReader reader) in stardewvalley\Farmer\Netcode\NetRef.cs:line 355
at Netcode.NetRefTypes.ReadType(BinaryReader reader) in stardewvalley\Farmer\Netcode\NetRef.cs:line 332
at Netcode.NetRefBase`2.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 220
at Netcode.NetArray`2.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetArray.cs:line 247
at Netcode.NetExtendableRef`2.ReadValueFull(T value, BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 263
at Netcode.NetRefBase`2.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 222
at Netcode.NetList`2.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetList.cs:line 285
at Netcode.NetFields.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetFields.cs:line 107
at Netcode.NetExtendableRef`2.ReadValueFull(T value, BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 263
at Netcode.NetRefBase`2.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 222
at Netcode.NetDictionary`5.ReadFieldFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetDictionary.cs:line 365
at Netcode.NetDictionary`5.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetDictionary.cs:line 545
at Netcode.NetFields.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetFields.cs:line 107
at Netcode.NetExtendableRef`2.ReadValueFull(T value, BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 263
at Netcode.NetRefBase`2.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 222
at Netcode.NetRoot`1.Connect(BinaryReader reader) in stardewvalley\Farmer\Netcode\NetRoot.cs:line 85
at StardewValley.Multiplayer.readObjectFull[T](BinaryReader reader) in stardewvalley\Farmer\Farmer\Network\Multiplayer.cs:line 807
at StardewValley.Multiplayer.readActiveLocation(IncomingMessage msg) in stardewvalley\Farmer\Farmer\Network\Multiplayer.cs:line 1304
at StardewValley.Multiplayer.processIncomingMessage_PatchedBy<spacechase0.SpaceCore>(Multiplayer this, IncomingMessage msg)
at StardewModdingAPI.Framework.SMultiplayer.OnClientProcessingMessage(IncomingMessage message, Action`1 sendMessage, Action resume)
at StardewValley.SDKs.GalaxyNetClient.onReceiveMessage(GalaxyID peer, Stream messageStream)
at StardewValley.SDKs.GalaxySocket.Receive(Action`1 onConnection, Action`2 onMessage, Action`1 onDisconnect, Action`1 onError)
at StardewValley.SDKs.GalaxyNetClient.receiveMessagesImpl()
at StardewValley.Network.Client.receiveMessages()
at StardewValley.Menus.FarmhandMenu.update(GameTime time)
at StardewValley.Menus.TitleMenu.update(GameTime time)
at StardewValley.Game1.updateActiveMenu(GameTime gameTime)
at StardewValley.Game1._update(GameTime gameTime)
at StardewValley.Game1.Update(GameTime gameTime)
at StardewModdingAPI.Framework.SCore.OnPlayerInstanceUpdating(SGame instance, GameTime gameTime, Action runUpdate)
[SMAPI] An error occurred in the overridden update loop: InvalidOperationException: Operation is not valid due to the current state of the object.
at Netcode.NetRefTypes.ReadGenericType(BinaryReader reader) in stardewvalley\Farmer\Netcode\NetRef.cs:line 355
at Netcode.NetRefTypes.ReadType(BinaryReader reader) in stardewvalley\Farmer\Netcode\NetRef.cs:line 332
at Netcode.NetRefBase`2.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 220
at Netcode.NetArray`2.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetArray.cs:line 247
at Netcode.NetExtendableRef`2.ReadValueFull(T value, BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 263
at Netcode.NetRefBase`2.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 222
at Netcode.NetList`2.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetList.cs:line 285
at Netcode.NetFields.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetFields.cs:line 107
at Netcode.NetExtendableRef`2.ReadValueFull(T value, BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 263
at Netcode.NetRefBase`2.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 222
at Netcode.NetDictionary`5.ReadFieldFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetDictionary.cs:line 365
at Netcode.NetDictionary`5.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetDictionary.cs:line 545
at Netcode.NetFields.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetFields.cs:line 107
at Netcode.NetExtendableRef`2.ReadValueFull(T value, BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 263
at Netcode.NetRefBase`2.ReadFull(BinaryReader reader, NetVersion version) in stardewvalley\Farmer\Netcode\NetRef.cs:line 222
at Netcode.NetRoot`1.Connect(BinaryReader reader) in stardewvalley\Farmer\Netcode\NetRoot.cs:line 85
at StardewValley.Multiplayer.readObjectFull[T](BinaryReader reader) in stardewvalley\Farmer\Farmer\Network\Multiplayer.cs:line 807
at StardewValley.Multiplayer.readActiveLocation(IncomingMessage msg) in stardewvalley\Farmer\Farmer\Network\Multiplayer.cs:line 1304
at StardewValley.Multiplayer.processIncomingMessage_PatchedBy<spacechase0.SpaceCore>(Multiplayer this, IncomingMessage msg)
at StardewModdingAPI.Framework.SMultiplayer.OnClientProcessingMessage(IncomingMessage message, Action`1 sendMessage, Action resume)
at StardewValley.SDKs.GalaxyNetClient.onReceiveMessage(GalaxyID peer, Stream messageStream)
at StardewValley.SDKs.GalaxySocket.Receive(Action`1 onConnection, Action`2 onMessage, Action`1 onDisconnect, Action`1 onError)
at StardewValley.SDKs.GalaxyNetClient.receiveMessagesImpl()
at StardewValley.Network.Client.receiveMessages()
at StardewValley.Menus.FarmhandMenu.update(GameTime time)
at StardewValley.Menus.TitleMenu.update(GameTime time)
at StardewValley.Game1.updateActiveMenu(GameTime gameTime)
at StardewValley.Game1._update(GameTime gameTime)
at StardewValley.Game1.Update(GameTime gameTime)
at StardewModdingAPI.Framework.SCore.OnPlayerInstanceUpdating(SGame instance, GameTime gameTime, Action runUpdate)
[SMAPI] An error occurred in the overridden update loop: NullReferenceException: Object reference not set to an instance of an object.
at StardewValley.Objects.BedFurniture.ApplyWakeUpPosition(Farmer who) in stardewvalley\Farmer\Farmer\Objects\BedFurniture.cs:line 199
at StardewValley.Network.Client.setUpGame() in stardewvalley\Farmer\Farmer\Network\Client.cs:line 208
at StardewValley.Network.Client.receiveServerIntroduction(BinaryReader msg) in stardewvalley\Farmer\Farmer\Network\Client.cs:line 291
at StardewModdingAPI.Framework.SMultiplayer.OnClientProcessingMessage(IncomingMessage message, Action`1 sendMessage, Action resume) in SMAPI\Framework\SMultiplayer.cs:line 330
at StardewValley.SDKs.GalaxyNetClient.onReceiveMessage(GalaxyID peer, Stream messageStream) in stardewvalley\Farmer\Farmer\SDKs\GalaxyNetClient.cs:line 98
at StardewValley.SDKs.GalaxySocket.Receive(Action`1 onConnection, Action`2 onMessage, Action`1 onDisconnect, Action`1 onError) in stardewvalley\Farmer\Farmer\SDKs\GalaxySocket.cs:line 769
at StardewValley.SDKs.GalaxyNetClient.receiveMessagesImpl() in stardewvalley\Farmer\Farmer\SDKs\GalaxyNetClient.cs:line 63
at StardewValley.Network.Client.receiveMessages() in stardewvalley\Farmer\Farmer\Network\Client.cs:line 75
at StardewValley.Menus.FarmhandMenu.update(GameTime time) in stardewvalley\Farmer\Farmer\Menus\FarmhandMenu.cs:line 299
at StardewValley.Menus.TitleMenu.update(GameTime time) in stardewvalley\Farmer\Farmer\Menus\TitleMenu.cs:line 1714
at StardewValley.Game1.updateActiveMenu(GameTime gameTime) in stardewvalley\Farmer\Farmer\Game1.cs:line 5470
at StardewValley.Game1._update(GameTime gameTime) in stardewvalley\Farmer\Farmer\Game1.cs:line 4917
at StardewValley.Game1.Update(GameTime gameTime) in stardewvalley\Farmer\Farmer\Game1.cs:line 3974
at StardewModdingAPI.Framework.SCore.OnPlayerInstanceUpdating(SGame instance, GameTime gameTime, Action runUpdate) in SMAPI\Framework\SCore.cs:line 749
 
Top