09-15-2021 08:09 - edited 09-22-2021 02:38
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-15-2021 08:09 - edited 09-22-2021 02:38
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I try to apply the navigation pattern described in this sample app:
https://github.com/Fitbit/sdk-app-demo
When I build it there is any warning, but when I build my app (https://github.com/alessandroame/F3KBit/tree/stopwatch) this is the output:
[16:58:24][warn][app] app\index.js (18:0) Illegal reassignment to import 'document'
16: }
17:
18: document.onload=()=>{
^
19: document.error("document.onload");
20: }
[16:58:24][warn][app] app\index.js (21:0) Illegal reassignment to import 'document'
19: document.error("document.onload");
20: }
21: document.onreload=()=>{
^
22: document.error("document.onREload");
23: }
[16:58:24][warn][app] app\views\launchTrigger.js (45:2) Illegal reassignment to import 'document'
43: trigger.start();
44:
45: document.onbeforeunload=(evt)=>{
^
46: trigger.stop();
47: };
[16:58:24][warn][app] app\views\landingTrigger.js (45:2) Illegal reassignment to import 'document'
43: }, 50);
44:
45: document.onbeforeunload=(evt)=>{
^
46: evt.preventDefault();
47: return false;
What is the reason for the warnings?
12-17-2022 22:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-17-2022 22:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Dont you hate it when no-one replies.
As far as I cant see, they (fitdev) have locked down some functions. Those functions had too much power earlier on, so they're trying to pull back on the dev being able to interact directly with the document model. I -like you-, like the ability to ensure I dont accidentally exit the app. I've added a confirmation box on my exit app procedure, so I can confirm that I was meant to exit... I personally liked the buttons earlier on too as I was far less likely to accidentally press the buttons that knocking the screen.

12-18-2022 10:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


12-18-2022 10:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @alessandroame - it could be document.onload has been deprecated. .onunload still exists.
Author | ch, passion for improvement.

