JAST icon indicating copy to clipboard operation
JAST copied to clipboard

Things get required twice

Open emiloberg opened this issue 9 years ago • 2 comments

Steps to reproduce:

  1. Cloned repo
  2. Changed UUID in Gulpfile.js
  3. Updated <sdk-version>3.5.0.GA</sdk-version> to <sdk-version>3.5.1.GA</sdk-version> in tiapp.xml

When I'm running with grunt dev -p ios and press the login button in the simulator, I get the following printout in the terminal:

[INFO] [iphone, 8.3, 192.168.1.68] [
    "OK"
]
[INFO] [iphone, 8.3, 192.168.1.68] [
    "OK"
]

Notice that I get it twice.

And if I add Ti.API.debug('index.js runned!'); as line 1 in src/controllers/index.js I get that printout twice as well. It looks like this:

...
[INFO] [iphone, 8.3, 192.168.1.68] Requiring: /Users/emiloberg/Library/Developer/CoreSimulator/Devices/11146D86-F1A5-468C-9D0E-8231FF0F6B72/data/Containers/Data/Application/89780833-3946-4279-885B-1123B90B53B7/Documents/JAST/iphone/alloy/controllers/index.js
[DEBUG] [iphone, 8.3, 192.168.1.68] index.js runned!
[INFO] [iphone, 8.3, 192.168.1.68] Requiring: /Users/emiloberg/Library/Developer/CoreSimulator/Devices/11146D86-F1A5-468C-9D0E-8231FF0F6B72/data/Containers/Data/Application/89780833-3946-4279-885B-1123B90B53B7/Documents/JAST/iphone/nano.js
[INFO] [iphone, 8.3, 192.168.1.68] JAST launched.
[INFO] [iphone, 8.3, 192.168.1.68] Requiring: /Users/emiloberg/Library/Developer/CoreSimulator/Devices/11146D86-F1A5-468C-9D0E-8231FF0F6B72/data/Containers/Data/Application/89780833-3946-4279-885B-1123B90B53B7/Documents/JAST/iphone/alloy/controllers/BaseController.js
[INFO] [iphone, 8.3, 192.168.1.68] Requiring: /Users/emiloberg/Library/Developer/CoreSimulator/Devices/11146D86-F1A5-468C-9D0E-8231FF0F6B72/data/Containers/Data/Application/89780833-3946-4279-885B-1123B90B53B7/Documents/JAST/iphone/alloy/widgets/yy.alert/controllers/widget.js
[INFO] [iphone, 8.3, 192.168.1.68] Requiring: /Users/emiloberg/Library/Developer/CoreSimulator/Devices/11146D86-F1A5-468C-9D0E-8231FF0F6B72/data/Containers/Data/Application/89780833-3946-4279-885B-1123B90B53B7/Documents/JAST/iphone/alloy/controllers/index.js
[DEBUG] [iphone, 8.3, 192.168.1.68] index.js runned!
...

It looks like a lot of things is required twice. See the full log: https://gist.github.com/emiloberg/76619f49f6ff64c97d74#file-gistfile1-sh-L244-L273

Any idea why this is?

emiloberg avatar May 04 '15 10:05 emiloberg

I've seen the same but it seems to be a problem with logging, try Ti.API.debug('index.js ran!', Math.random());, from what I've seen the repeated log statements share the same random number which suggest it's the logger that is the problem.

albemuth avatar Aug 13 '15 22:08 albemuth

I noticed this too. If it's just the logger I'm just going to ignore it. It's weird though.

gregpardo avatar Jan 08 '16 18:01 gregpardo