You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{Route}from"@rbxts/yetanothernet";constdefaultConfiguration={Channel: "Reliable",Event: "default",}// Replicate Matter ComponentsconstMatterReplication=newRoute(defaultConfiguration);// Signal that the Player has loadedconstPlayerLoaded: Route<[boolean]>=newRoute(defaultConfiguration);export={MatterReplication: MatterReplication,PlayerLoaded: PlayerLoaded,}
This results in the following error by default: Argument of type '{ Channel: string; Event: string; }' is not assignable to parameter of type 'Configuration'. Types of property 'Channel' are incompatible. Type 'string' is not assignable to type '"Reliable" | "Unreliable" | undefined'.
I fixed this by moving the Configuration type to the Net namespace
import{Route,Configuration}from"@rbxts/yetanothernet";constdefaultConfiguration: Configuration={Channel: "Reliable",Event: "default",};// Replicate Matter ComponentsconstMatterReplication=newRoute(defaultConfiguration);// Signal that the Player has loadedconstPlayerLoaded: Route<[boolean]>=newRoute(defaultConfiguration);export={MatterReplication: MatterReplication,PlayerLoaded: PlayerLoaded,};
The text was updated successfully, but these errors were encountered:
In the typescript documentation for Matter setup the following routes.ts is recommended:
This results in the following error by default:
Argument of type '{ Channel: string; Event: string; }' is not assignable to parameter of type 'Configuration'. Types of property 'Channel' are incompatible. Type 'string' is not assignable to type '"Reliable" | "Unreliable" | undefined'.
I fixed this by moving the
Configuration
type to theNet
namespaceand make the
defaultConfiguration
use this typeThe text was updated successfully, but these errors were encountered: