Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

App load error on Versa

Traced an error on the actual Versa original to this message:

 

"Unhandled exception: Error: failed to pre-parse snapshot" at (null):1,1

Before any console message appears in the log.

The initial screen loads but is not fully populated.

 

Does anyone know what this means?

 

App works correctly on a Versa 2.

 

It actually works fine in the 0.94 OS Simulator, so impossible to debug it.

Author | ch, passion for improvement.

Best Answer
0 Votes
6 REPLIES 6

Rebuilding will probably make this go away.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

@GondwanaThanks, but unfortunately not, using developer bridge shows the error - otherwise the app loads partially and stops and unloads.

 

Do you know what might provoke this strange behaviour?

Author | ch, passion for improvement.

Best Answer
0 Votes

I don't know for sure, but my understanding is that a clockface's code is converted into a 'snapshot' for quick loading and execution on the watch. I think it's like a memory image of the bytecode for the clockface. Read up on Jerryscript for more info.

 

My next guess is that, when the interpreter's run-time environment has to load the clockface, it pre-parses the snapshot to make sure it's valid. If the snapshot seems invalid, we get the message you quoted.

 

I don't know what can cause a snapshot to be unparseable. Since rebuilding the code often makes the problem go away, I assume it's a problem with the build process. If you can reproduce this problem, it must also be possible to produce an unparseable snapshot by having something problematic in your code. Since I've never been able to reproduce the issue, I don't know what that could be.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Based on this, maybe an unparseable snapshot could be created if it requires too much memory. But I'm pretty sure there can be other reasons.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Thank you @Gondwana  - it is strange - have all sorts of other issues with 4.3 and Versa originals [pre Versa 2] since it was released.

 

The build process seems to produce completely different code, such that a program built with 4.2 and installed in production won't even install if built in 4.3 [with no source change]. Removing significant portions of the code it still fails with 4.3.

 

So this may be another of those issues.

 

Author | ch, passion for improvement.

Best Answer

@Gondwana  Tried CLI SDK 4.2 with package.json

 "devDependencies": {
"@fitbit/sdk": "^4.2.0",
"@fitbit/sdk-cli": "^1.7.0"
},

 

but the sideload reports the following :

 

manifest Version 6

sdk Version device Api 6.0.0

companion Api 3.3.0

 

so don't think SDK 4.2 is being used, anyway gives the same error as with 4.3.0

Author | ch, passion for improvement.

Best Answer