Acknowledged

Visual Studio Code and makeWebRequest and SDK 4.1.6+

Hi,
this does not work with SDK 4.1.6 and later in Visual Studio Code:
Communications.makeWebRequest("https://api.openweathermap.org/data/2.5/weather", params, options, method(:onReceiveWeather));
Error:
Invalid '$.Toybox.Lang.Method(responseCode as Any, data as Any) as Any'
passed as parameter 4 of type
'PolyType<(callback(responseCode as $.Toybox.Lang.Number, data as Null or $.Toybox.Lang.Dictionary or $.Toybox.Lang.String) as Void)
or
(callback(responseCode as $.Toybox.Lang.Number, data as Null or $.Toybox.Lang.Dictionary or $.Toybox.Lang.String, context as $.Toybox.Lang.Object) as Void)>'.
Unfortunately I have no idea what could be causing this.
Has the function been removed or changed?
Regards
Joerg
Parents
  • Starting with the 4.1.6 SDK (well, and 4.2.0 beta 1) type checking is on by default.  As this worked prior to 4.1.6, try turning type checking off.  You can do that with the settings extension in VS Code here:

    Then you can look at why type checking is reporting an issue

Comment
  • Starting with the 4.1.6 SDK (well, and 4.2.0 beta 1) type checking is on by default.  As this worked prior to 4.1.6, try turning type checking off.  You can do that with the settings extension in VS Code here:

    Then you can look at why type checking is reporting an issue

Children