#TF2 Extension

1 messages · Page 1 of 1 (latest)

brave palm
#

Somewhere in your code, you're passing a function where you should be passing a string.

#

It's your deserialize load order function @weary bloom

#

On L125 and L113 you've passed different arguments to those required by the function on L199

#

Line 113 - You're passing the context objectt

deserializeLoadOrder: async () => await DeserializeLoadOrder(context),

Line 125 - You're passing just the API object.

currentLO = await deserializeLoadOrder(context.api);

Line 199 - The actual function you've written requires two arguments,

async function DeserializeLoadOrder(discovery, api) {}
#

This why I like Typescript 😛 It tells you if you're passing the wrong objects into functions.

weary bloom
#

Do I just rename the .js to .ts?

brave palm
#

It would require setting up the extension from scratch so probably not worth it at this stage

weary bloom
#

Well there's not that much code

#

Couldn't be that hard

#

I mean how different can typescript be to javascript

#

Plus I barely know javascript anyway

brave palm
#

Typescript include a "compile" step that basically converts it back to pure JS.

weary bloom
#

ohhh okay

brave palm
weary bloom
#

why is the index a .tsx? and not .ts?

weary bloom
brave palm
weary bloom
#

Okay cool, I only need to write the filepath to the mod.vpk

#

Shouldn't be hard to change that

#

(last words before insanity)

weary bloom
brave palm
#

You probably should use VSCode with the Typescript support built in. You'd also need to run npm install to set up the libraries to stop the red lines