pwa-builder / PWABuilder-CLI

Node.js tool for App Generation
Other
1.63k stars 142 forks source link

Https not properly detected #259

Closed dacoinminster closed 6 years ago

dacoinminster commented 7 years ago

I've tried to create a hosted web app a couple different ways using Manifold JS, and I get various errors every way I do it. The cleanest way seems to be to follow this tutorial: https://github.com/manifoldjs/manifoldJS/wiki/Getting-Started

I literally followed the tutorial step by step, using two different websites (my.cozi.com, and www.cookinglightdiet.com), but whenever I try to run the app ("manifoldjs run windows10"), it just shows an error message "This app requires an internet connection and looks like we are having trouble connecting right now."

I spoke with a Microsoft employee who had the following suggestions:

I am guessing that the issue has to do with the loop-back-exemption that we set in the background, it must not be working on your VM. Can you do me a favor and try two things:

First, lets just make sure you scope is set properly (pretty sure it is), but after you create a project look in this file “{sitename}/windows10/manifest/appxmanifest.xml” you should have a section in the xml that lists your domain:

Make sure if you are https it shows https and vice versa. If you use both http pages and https then make sure they are both listed here. If that is all correct (I suspect it is) they it is a problem with the loop back, where the tool probably doesn’t have the privileges it needs on the vm. Its an easy fix as well. Just download this small tool onto your vm and run it: http://loopback.codeplex.com/ . check the box next to your app, which will probably be at the top of the list. You can then open your app from the start menu again, and all should be well!

Suggestion #1 fixed the problem for me (I duplicated the uap:Rule so I had one for http as well as https).

ManifoldJS really ought to just do that by default, or at the very least, it should be mentioned in the tutorial!

Thanks

boyofgreen commented 7 years ago

Hey JR, Thanks for the feedback. I talk with the team but I think the right way to go is to add both the http and https automatically. I can't see where that would ever be a negative thing. I took a look, and both the sites you use as examples forward you over to https when you type in http, which is actually a very common pattern we should just code for. Thanks again, and let me know if you run into any other issues. Thanks Jeff