question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: setting anything in "allowNavigation" capacitor.config.json will provoke ERR_CONNECTION_REFUSED

See original GitHub issue

Bug Report

Capacitor Version

npx cap doctor output:

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 1.4.0

@capacitor/core: 1.4.0

@capacitor/android: 1.4.0

@capacitor/ios: 1.4.0

Installed Dependencies:

@capacitor/cli 1.4.0

@capacitor/android 1.4.0

@capacitor/core 1.4.0

@capacitor/ios 1.4.0

[error] Main Acitivity “.MainActivity” is not in manifest package “com.bubblevr.wedo”. Please update the packages to be the same.

Affected Platform(s)

  • Android
  • iOS
  • Electron
  • Web

Current Behavior

In order to fix some access issue (XHR call to these domains would be cancelled on iOS without it) I am setting the following json in capacitor.config.json

"server": { "allowNavigation": [ "localhost", "ec2-35-181-50-61.eu-west-3.compute.amazonaws.com:1337", "ec2-15-188-204-14.eu-west-3.compute.amazonaws.com:1337", "wedo-front-1670696535.eu-west-3.elb.amazonaws.com" ] }

But as soon as I set these, I get an error page on load of the app on android "the webpage at http://localhost/ could not be loaded because : net::ERR_CONNECTION_REFUSED. Screenshot 2020-01-30 at 14 22 44

I have also tried adding “*” in the listed of allowed origins, but I cannot get it to work. Removing the “allowNavigation” array will let my app load properly.

Expected Behavior

Application load should not be blocked.

Other Technical Details

npm --version output: 6.4.1 node --version output: v11.0.0

pod --version output (iOS issues only):

Other Information

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:22 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
bobbydowlingcommented, Jul 9, 2021

Question similar to this… I have the exact same issue however, I don’t have “localhost” in “allowNavigation”. I have my auth provider url in “allowNavigation” only.

The idea is for the app to redirect to the auth provider, show the user the login flow, then redirect back to http://localhost/callback/

But I get the connect refused screen above.

Any other ideas?

image

4reactions
itsferasinccommented, Jul 9, 2021

Question similar to this… I have the exact same issue however, I don’t have “localhost” in “allowNavigation”. I have my auth provider url in “allowNavigation” only.

The idea is for the app to redirect to the auth provider, show the user the login flow, then redirect back to http://localhost/callback/

But I get the connect refused screen above.

Any other ideas?

image

same thing, still looking for solution

Read more comments on GitHub >

github_iconTop Results From Across the Web

Willing to pay: err_connection_refused android - Capacitor
bug : setting anything in "allowNavigation" capacitor.config.json will provoke ERR_CONNECTION_REFUSED. opened 01:31PM - 30 Jan 20 UTC.
Read more >
Capacitor Configuration | Capacitor Documentation
The Capacitor configuration file is used to set high-level options for Capacitor tooling. ... you can use a capacitor.config.json file in the same...
Read more >
Can I navigate onto the web without leaving a Capacitor ...
You can allow navigation to certain urls by adding allowNavigation inside the server object on the capacitor.config.json file
Read more >
Ionic: Http://Localhost/Callback Code= Could Not Be Loaded ...
I tried on ios and it gives a CORS error saying capacitor://localhost is not ... Setting Anything In Allownavigation Capacitor Config Json Will...
Read more >
Capacitor: Running a Web App on Mobile - DigitalOcean
I'll be using ios for my example. $ npx cap add ios. Uh oh, running this with the default settings gives us this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found