Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reload fails #114

Closed
tariqinaam opened this issue Apr 10, 2023 · 7 comments
Closed

reload fails #114

tariqinaam opened this issue Apr 10, 2023 · 7 comments

Comments

@tariqinaam
Copy link

Hi,
I have wits running on mac OS with a react tizen custom project. I am trying to use live reload using tizen emulator.
On initial run of wits -s or wits -w, it loads the app in emulator. However upon changing a file, app failed to reload with error messaage on emulator says

Unable to fiind page you requested
file:/// may be down or moved to new address

here is detail log
At the end of this log it says chrome disconnected, however chrome stays connected.

wits -s --verbose
 _      ____________  
| | /| / /  _/_  __/__
| |/ |/ // /  / / (_-<
|__/|__/___/ /_/ /___/

Start running Wits............

[@tizentv/tools]tools.getToolPath: toolName = sdb

      > [ Stored Information ]

      > baseAppPath  : /Users/xxxx/development/ott
      > width        : 1920
      > deviceIp     : 0.0.0.0
      > isDebugMode  : true

      > profile path : /Users/xxxx/tizen-studio-data/profile/profiles.xml
      > hostIp       : 10.50.69.11

List of devices attached 
emulator-26101          device          t-0409-1

secure_protocol:enabled
intershell_support:disabled
filesync_support:pushpull
usbproto_support:disabled
sockproto_support:enabled
syncwinsz_support:enabled
sdbd_rootperm:disabled
rootonoff_support:disabled
encryption_support:disabled
zone_support:disabled
multiuser_support:enabled
cpu_arch:x86
sdk_toolpath:/home/owner/share/tmp/sdk_tools
profile_name:tv
vendor_name:Samsung
can_launch:tv-samsung
device_name:Tizen
platform_version:7.0
product_version:4.0
sdbd_version:2.2.31
sdbd_plugin_version:3.8.5_EM_REL
sdbd_cap_version:1.0
log_enable:disabled
log_path:/tmp
appcmd_support:disabled
appid2pid_support:enabled
pkgcmd_debugmode:enabled
netcoredbg_support:enabled
architecture:32
platform_build_version:7.0


content src is : dist/index.html

Start packaging Samsung Tizen TV Platform......

[webide-common-tizentv]projectHelper.buildWidget() profilePath = /Users/xxxx/tizen-studio-data/profile/profiles.xml, excludeFiles = undefined
After build package, signature temporary files were removed
[webide-common-tizentv]projectHelper.widget.on(): Build Package completed!
============================== Build Package completed!

============================== Start to install the package

uninstall MTAPlusWITs
app_id[MTAPlusWITs] uninstall start
app_id[MTAPlusWITs] uninstalling[4]
app_id[MTAPlusWITs] uninstalling[100]
app_id[MTAPlusWITs] uninstall completed
spend time for wascmd is [1148]ms

WARNING: Your data are to be sent over an unencrypted connection and could be read by others.
pushed                       WITs.wgt   100%        136KB           0KB/s
1 file(s) pushed. 0 file(s) skipped.
/usr/local/lib/node_modules/@tizentv/wits/container/WITs.wgt   1474KB/s (139911 bytes in 0.092s)


install MTAPlusWITs
package_path /home/owner/share/tmp/sdk_tools/WITs.wgt
app_id[MTAPlusWITs] install start
app_id[MTAPlusWITs] installing[10]
app_id[MTAPlusWITs] installing[13]
app_id[MTAPlusWITs] installing[97]
app_id[MTAPlusWITs] installing[100]
app_id[MTAPlusWITs] install completed
spend time for wascmd is [1374]ms


terminate app QXQQPihnR1.MTAPlusWITs
spend time for wascmd is [16]ms

... successfully launched pid = 27283 with debug 1 port: 36881



listening on 4662
a user connected
new client connected, id = Qbr2nv1nDRXuIRg0AAAB 
socket on::::push_request
Total File Number : 170
socket on::::watch_request
hostAppPath /home/owner/share/tmp/sdk_tools/MTAPlusWITs
[Warning]: Failed to wrapped FileSystem to contents file.
Please install a Chrome browser. Error: connect ECONNREFUSED ::1:58345
Please install a Chrome browser. Error: connect ECONNREFUSED ::1:58344

/Users/xxxx/development/ott/src/pages/home.js update
watch file : /src/pages/home.js
Program output : WARNING: Your data are to be sent over an unencrypted connection and could be read by others.
pushed                        home.js   100%       3424 B           0KB/s
1 file(s) pushed. 0 file(s) skipped.
/Users/xxxx/development/ott/src/pages/home.js   57KB/s (3424 bytes in 0.058s)
@pwsses
Copy link
Contributor

pwsses commented Apr 10, 2023

Hello.
Have you seen your App, not the Wits loading screen?

in the log, It success launch App with Wits, and push home.js file then reload app contents.

but As your report, It failed when reload windows.

try to it work well on chrome inspector console tab which connected by Wits.

let iframeElem = document.getElementById('contentHTML');
iframeElem.contentDocument.location.reload(true);

If that was not working, It is not Wits issue, maybe other issue. we will check together.

thank you.

@tariqinaam
Copy link
Author

tariqinaam commented Apr 10, 2023

Hello. Have you seen your App, not the Wits loading screen?

in the log, It success launch App with Wits, and push home.js file then reload app contents.

but As your report, It failed when reload windows.

try to it work well on chrome inspector console tab which connected by Wits.

let iframeElem = document.getElementById('contentHTML');
iframeElem.contentDocument.location.reload(true);

If that was not working, It is not Wits issue, maybe other issue. we will check together.

thank you.

Thanks for quick reply.
yes, console in vscode shows content is pushed, however emulator failed to locate the package content.
reloading via chrome web inspector console command gives same error.
After reload command, whole content from source tab disappear. Not exactly sure what causing this.
https://www.awesomescreenshot.com/image/38807789?key=aa9d90da167449026a6c502c7bf5726b

@tariqinaam
Copy link
Author

Noticed another thing here. Even after the first successful load. index file in content source (web inspector source tab), shows no content.
https://www.awesomescreenshot.com/image/38807932?key=b455ef45b9f01b0aab07b5fb14356d8f

@tariqinaam
Copy link
Author

Noticed another thing here. Even after the first successful load. index file in content source (web inspector source tab), shows no content. https://www.awesomescreenshot.com/image/38807932?key=b455ef45b9f01b0aab07b5fb14356d8f

Ignore my comment in last reply, i can see index.html content on first load.

@prozanne
Copy link
Member

prozanne commented Apr 11, 2023

Hi :)
First, sorry for your inconvenience.
When I tried to reproduce what you've experienced.
But in my case It works properly...
I think I need to look into more....

gif

And then, I refreshed at the chrome inspector with F5. But It's still connected and I could use live reload feature.

At first, I thought the error what you've got might be a problem. "Please install a Chrome browser. Error: connect ECONNREFUSED ::1:51557"
Even though I also see the same error message in my side, But It still works....

listening on 4502
a user connected
new client connected, id = ZA229zqEdjuexjdwAAAB
socket on::::push_request
Total File Number : 19
socket on::::watch_request
D:\dev\tizen\workspace230411\OfflineClockImage\css\style.css update
watch file : /css/style.css
Program output : WARNING: Your data are to be sent over an unencrypted connection and could be read by others.
pushed style.css 100% 184 B 0KB/s
1 file(s) pushed. 0 file(s) skipped.
D:/dev/tizen/workspace230411/OfflineClockImage/css/style.css 4KB/s (184 bytes in 0.039s)

D:\dev\tizen\workspace230411\OfflineClockImage\css\style.css update
watch file : /css/style.css
Program output : WARNING: Your data are to be sent over an unencrypted connection and could be read by others.
pushed style.css 100% 182 B 0KB/s
1 file(s) pushed. 0 file(s) skipped.
D:/dev/tizen/workspace230411/OfflineClockImage/css/style.css 3KB/s (182 bytes in 0.051s)

Please install a Chrome browser. Error: connect ECONNREFUSED ::1:51557
Please install a Chrome browser. Error: connect ECONNREFUSED ::1:51558
D:\dev\tizen\workspace230411\OfflineClockImage\css\style.css update
watch file : /css/style.css
Program output : WARNING: Your data are to be sent over an unencrypted connection and could be read by others.
pushed style.css 100% 184 B 0KB/s
1 file(s) pushed. 0 file(s) skipped.
D:/dev/tizen/workspace230411/OfflineClockImage/css/style.css 3KB/s (184 bytes in 0.045s)

D:\dev\tizen\workspace230411\OfflineClockImage\css\style.css update
watch file : /css/style.css
Program output : WARNING: Your data are to be sent over an unencrypted connection and could be read by others.
pushed style.css 100% 185 B 0KB/s
1 file(s) pushed. 0 file(s) skipped.
D:/dev/tizen/workspace230411/OfflineClockImage/css/style.css 3KB/s (185 bytes in 0.049s)

disconnect, id = ZA229zqEdjuexjdwAAAB
a user connected
new client connected, id = ealqjCVN0vBD90ovAAAD
socket on::::push_request
Total File Number : 19
socket on::::watch_request
D:\dev\tizen\workspace230411\OfflineClockImage\css\style.css update
watch file : /css/style.css
Program output : WARNING: Your data are to be sent over an unencrypted connection and could be read by others.
pushed style.css 100% 186 B 0KB/s
1 file(s) pushed. 0 file(s) skipped.
D:/dev/tizen/workspace230411/OfflineClockImage/css/style.css 3KB/s (186 bytes in 0.052s)

Well...
And I'm gonna test it again with mac in a few days. It might take a time.
If I figure out something new, I will let you know!

Thanks.

@tariqinaam
Copy link
Author

@prozanne @pwsses I have resolved this issue.
For anyone having similar issue with react App, check what router you are using.
I was using React BrowserRouter and it was causing file path to get lost on reload. Switching it to MemoryRouter fixed the issue with reloading.
thanks for you help.

@prozanne
Copy link
Member

@prozanne @pwsses I have resolved this issue. For anyone having similar issue with react App, check what router you are using. I was using React BrowserRouter and it was causing file path to get lost on reload. Switching it to MemoryRouter fixed the issue with reloading. thanks for you help.

Thanks for sharing your solution to all.
We should've checked react application environment too. Sorry again for the inconvenience.
Have a good day.

Happy coding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants