roblox-ts

R

roblox-ts

Join the community to ask questions about roblox-ts and get answers from other members.

Join

[Flamework]: Failed to load! TS version mismatch detected

I keep getting this message, i don't know how to fix it. I have 5.2.2 installed on NPM and bun. package.json: ```json { "name": "zoo-game-ts",...
No description

how to type an empty message with tether

i want the message to be empty similar to Event:FireEvent()
Solution:
this worked
[messages.CLIENT_READY]: undefined;
[messages.CLIENT_READY]: undefined;
...

ECS tips?

I'm going to try ECS. (JECS to be more precise) are there any tips on how to use it that I can use? Perhaps something should not be used, or, on the contrary, more than others. Maybe there is a template.
Solution:
go to the jecs project channel in ROSS and look through the pins in there
Message Not Public
Sign In & Join Server To View

@rbxts/jabby errors when required

Solution:
the solution was changing the @rbxts/jabby/out/jabby import to @rbxts/jabby
No description

getting mismatched data when using @rbxts/yetanothernet

Server Code ```ts const syncer = server({ atoms }); syncer.connect((player, payload) => {...
No description

Humanoid Pathfinding jump issue

Notice how my pathfinding produces a two jump waypoints (marked in red). But it only jumps for 1 of them? Why is that?

Flamework TestEZ

Are there any examples of how to test services or controllers? I figure I'd have to use the Dependency macro, but I'm unsure how.

rbxts/Jabby Vide Dependency Causing Errors in React Code

I am in the process of porting over my react code over a different project that uses Jecs with Jabby, the code is fully functional on previous project, but the presence of Jabby with the Vide dependency is causing errors in the new one
Solution:
> Clear the content of index.d.ts in node_modules/@rbxts/vide/src (do NOT delete it, that will cause compile errors) > npx patch-package @rbxts/vide to automatically apply patch on later installs...
No description

How to mock a library function in jest

I tried doing .spyOn to spy on the function but it didn't work. I don't think .mock works because it requires a module script, and roblox-ts strings will mess up its mockings

lapis readonly

I'm trying to create a wrapper function that simplifies reading and writing player data. However, I'm encountering an error that says: "attempt to modify readonly table." Lapis is returning the data as a readonly table, so I need a way to safely create a mutable copy of this data, modify it, and then send it back to be written. ...

Proper cleanup if component errored

Is flamework doing a proper cleanup if the component errors in the constructor and/or in OnStart. cc: @Fireboltofdeath...

How to make discriminated union exhaustive while using t

```ts const GAME_MODES = ["STANDARD", "TOURNAMENT", "CRAZY"] as const; export type GameMode = (typeof GAME_MODES)[number]; export const gameModeToNameMap: Record<GameMode, string> = {...
Solution:
Apparently flamework/core is enough

Property 'values' does not exist on type 'Map<...>' change the 'lib' compiler option to 'es2015'+

Property 'values' does not exist on type 'Map<string, ReactElement<({ text, colour, valueInstance, maximumInstance, valueParam, maximumParam }: ValueBarProps) => Element, string | JSXElementConstructor<any>>>'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.ts(2550)
Property 'values' does not exist on type 'Map<string, ReactElement<({ text, colour, valueInstance, maximumInstance, valueParam, maximumParam }: ValueBarProps) => Element, string | JSXElementConstructor<any>>>'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.ts(2550)
i already changed that but the compiler doesn't recognize my changes to tsconfig!...
Solution:
Use https://www.npmjs.com/package/@rbxts/object-utils, then Object.values(yourMap)

getComponents returns nothing even when it should

hello I have script like this ```ts if (this.socketAddress.address === 0) { const components = Dependency<Components>();...

404 Can’t publish my package

I am trying to publish a package to @rbxts, but it says "<name>' is not in this registry.", I am apart of the org, I am signed into npm cli. What am I missing? https://github.com/MarcL01/RewindCSS - Ported RowindCSS to React "RewindCSS" My npm username is bigmarco254...
Solution:
SOLUTION: You have to submit your username to https://roblox-ts.com/join-org/success/ twice, once to get an invite email to join, after joining resubmit your username to https://roblox-ts.com/join-org/success/ and it "finalizes" it i guess

Cant use react

```json { "compilerOptions": { // required "allowSyntheticDefaultImports": true,...
Solution:
anyways, your roblox-ts is outdated. update it using npm i roblox-ts@latest

Jecs replication

Just trying to make my own replication system. Is there a better approach? ```ts function blah(world: World): void { Players.PlayerAdded.Connect((player: Player) => {...