Compiled output is nonsensical
lewisakura opened this issue · comments
Have been attempting to try to get Flamework to run for a little bit, but I seem to be struggling. I've used the template from rbxts-flamework/template with a couple of tooling changes (mainly just custom eslint config and pnpm with hoisting on for rbxts) but the output that is being generated doesn't seem to make sense at runtime.
The primary issue is the decorators. @Service()
usage will cause the following runtime error:
13:40:12.972 ServerScriptService.TS.services.ZirconService:25: attempt to call a table value - Server - ZirconService:25
13:40:12.972 Stack Begin - Studio
13:40:12.972 Script 'ServerScriptService.TS.services.ZirconService', Line 25 - Studio - ZirconService:25
13:40:12.972 Stack End - Studio
...where line 25 is the decorator application:
ZirconService = Service({})(ZirconService) or ZirconService
This also occurs on a completely new service via the snippet, so it's not something relating to the code I have written.
Debugging in Studio reveals that the Service decorator is a table containing func
, which I presume is the actual decorator call, and explains the error perfectly:
I am unsure of where to go from here, as I don't know if this is a compiler issue or user error.
Relevant packages and versions:
"rbxts-transformer-flamework": "1.0.0-beta.24",
"roblox-ts": "^2.2.0",
"typescript": "^5.3.3"
"@flamework/components": "1.0.0-beta.24",
"@flamework/core": "1.0.0-beta.24",
"@flamework/networking": "1.0.0-beta.24",
After looking at rbxts-flamework/template#11 and making the edits there, it turns out that TS 5.3 doesn't work correctly with Flamework. Downgrading to 5.2.2 works fine.