07-25-2021 14:20 - edited 07-25-2021 14:21
07-25-2021 14:20 - edited 07-25-2021 14:21
Hello,
I am having some issues with the SDK. None of the examples work as intended (including the sample apps) when I try to display text (or do a myriad of other things).
I seem to have narrowed it down to what seems to be a bug in the 4.3 SDK.
I have narrowed it down to the fact that wildcard imports fail every time. Here is an example.
Say I want to have an app that displays some test. I create an entry in index.js labeled "someText"
Then, in my index.js file, I write this...
import * as document from "document";
let someText = document.getElementById("someText");
someText.text = "Hey world, what's up?";
I notice two things.
1) The asterisk is not colored as a wild card
2) line 3 fails with the following error...
Unhandled exception: TypeError: Expected a function.
? at app/index.js:3,5
Yet, if I change it to
import document from "document";
let someText = document.getElementById("someText");
someText.text = "Hey world, what's up?";
It works as expected. This would not be a problem if all I was needing to do was write text, but it seems to affect every wildcard import, and I am trying to use filesystem at the moment, so I will need access to read and write (and do more complex operations with other libraries like JSON or CBOR after that).
Does anyone have any advice as to how to proceed?
07-25-2021 18:40
07-25-2021 18:40
As you have found the other link indicating the same error, it should be noted here that, there also seem to be other consequences to changing the import for 4.3.
There also seems to be a code generation issue in the 4.3 build as well. Such that the generated code no longer fits in the memory of pre Versa 2 watches if the project is large.
Rebuilding projects from existing source can now fail to load as a consequence, where it loaded and ran fine with a 4.2 build.
So there might be 2 errors with SDK 4.3.
If you don't change the import it won't run and if you do it won't fit.
Impasse!
Author | ch, passion for improvement.
07-26-2021 09:23
07-26-2021 09:23
It looks like the 4.3 version of the SDK did not correctly pin the old version of Rollup. We'll be addressing this in an update very soon.
07-27-2021 23:04
07-27-2021 23:04
I am seeing the same issue too.
07-28-2021 08:30 - edited 07-28-2021 08:53
07-28-2021 08:30 - edited 07-28-2021 08:53
Thank you for this. Messaging seems broken as well. I would revert to 4.2, but I am using the web portal, so the 4.3 update is forced. Here is the error.
import messaging from "messaging";
messaging.peerSocket.onopen = () => {
console.log("Companion Socket Open");
restoreSettings();
};
This produces the following error...
[11:19:41 AM]TypeError: Cannot read property 'peerSocket' of undefined
? at companion/index.js:5,1
Edit: The wildcard for messaging worked as expected on both the app and the companion.
09-22-2021 05:32
09-22-2021 05:32
Hi JonFitbit,
now it's end of september and I'm facing this issue as well. When is a bugfix/update expected?
09-22-2021 13:31
09-22-2021 13:31
I think the fix has been rolled out. If you're using CLI, you may need to update your SDK line and
npm i
or equivalent.