vss-web-extension-sdk
vss-web-extension-sdk copied to clipboard
getCurrentTheme is undefined when applyTheme is set to true
Getting an error on the Test Plans part of Azure DevOps when I have an extension that creates a field on a new Test Case. It works in a Bug work item type, but not a Test Case. Strange! It's related to the dark theme (or rather, all theming). I wanted the fields to change for different themes, so I set "applyTheme" to true in VSS.init as per the instructions here: https://github.com/Microsoft/vss-web-extension-sdk/pull/105
The error is only when I have "applyTheme" set to True in VSS.init:
VSS.init({ applyTheme: true});
This is in the latest npm package I have available, version 5.141.0.
The full error is:
TypeError: Cannot read property 'getCurrentTheme' of undefined at t.<anonymous> (https://cdn.vsassets.io/bundles/vss-bundle-common-vF-0Ug5ye1gMGhEh_MhVFtedFHwM2B3BR39u9k-GZvMU=:173:15862) at step (https://cdn.vsassets.io/bundles/vss-bundle-basejs-vHEZmoQW5VnU7gd0ksjL7j5fKkFB3cE7fn6EeL008n7I=:172:27) at Object.next (https://cdn.vsassets.io/bundles/vss-bundle-basejs-vHEZmoQW5VnU7gd0ksjL7j5fKkFB3cE7fn6EeL008n7I=:153:57) at https://cdn.vsassets.io/bundles/vss-bundle-basejs-vHEZmoQW5VnU7gd0ksjL7j5fKkFB3cE7fn6EeL008n7I=:146:75 at new Promise (<anonymous>) at __awaiter (https://cdn.vsassets.io/bundles/vss-bundle-basejs-vHEZmoQW5VnU7gd0ksjL7j5fKkFB3cE7fn6EeL008n7I=:142:16) at Object.initialHandshake (https://cdn.vsassets.io/bundles/vss-bundle-common-vF-0Ug5ye1gMGhEh_MhVFtedFHwM2B3BR39u9k-GZvMU=:173:15425) at t.invokeMethod (https://cdn.vsassets.io/bundles/vss-bundle-common-vF-0Ug5ye1gMGhEh_MhVFtedFHwM2B3BR39u9k-GZvMU=:97:3591) at t.onMessage (https://cdn.vsassets.io/bundles/vss-bundle-common-vF-0Ug5ye1gMGhEh_MhVFtedFHwM2B3BR39u9k-GZvMU=:97:4286) at n._handleMessageReceived (https://cdn.vsassets.io/bundles/vss-bundle-common-vF-0Ug5ye1gMGhEh_MhVFtedFHwM2B3BR39u9k-GZvMU=:97:8470)
I assume it's related to this change: https://github.com/Microsoft/vss-web-extension-sdk/pull/105
Thoughts?