question

se avatar image
se asked

NodeSDK typescript typings references seems broken

Hi, I recently upgraded our playfab NodeSDK, and found a lot of our code to not compile with typescript. It seems as there was a change introduced in the commit referenced below, which broke the type references for us. Perhaps we are doing something wrong?

The actual change happened in the file PlayFabSdk/index.d.ts. Essentially all the path-references was changed with a types-reference, but that does not seem to work correctly, at least not for me.

Reverting to playfab-sdk version 2.38.191029 resolves the issue for me.

I'm using typescript 3.7.3

// Example code where typings stops working
const winnerResults: PlayFabModule.IPlayFabSuccessContainer<PlayFabServerModels.GetLeaderboardResult>
        = await new Promise((resolve, reject) => {
            PlayFabServer.GetLeaderboard({
                MaxResultsCount: 3,
                StatisticName: statsName,
                StartPosition: 0,
                // @ts-ignore PS: there is another issue here which I created on github: https://github.com/PlayFab/NodeSDK/issues/103
                ProfileConstraints: { ShowLocations: true },
            }, (getLeaderboardError, getLeaderboardResult) => {
                getLeaderboardError ? reject(getLeaderboardError) : resolve(getLeaderboardResult)
            })
        })

Commit that introduces the change;

https://github.com/PlayFab/NodeSDK/commit/70a73999f24750a4cadbbcdfff117209ad66035a

sdks
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

se avatar image se commented ·

It is line #2 in the code above that stops working. PlayFabModule is no longer found, at least in our setup.

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

Thanks for the feedback. We will submit a report to the corresponding team. Please continue to keep track of the commits of Node.js SDK, and we will keep you informed if there is any updates from the team.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.