Exclamation marks added to URLs in Cordova

Viewed 256

I am developing a hybrid app using Cordova to wrap an existing React web application.

When I launch my App, once in a while the data does not get loaded and I noticed that the URLs use the file:// protocol instead of http://localhost:80803 and have an exclamation mark appended at the end.

How can I solve this?

See example below:

  • file:///api/metaData/!
  • file:///sideNavigation/!

enter image description here

1 Answers

This is strange and I admit that never occurred to me but these are some tests that you should try:

  1. Do you use react-router ? maybe It's the router that mess with the url, try using hash router in cordova app. I've found that it's way more solid.
  2. How do you build the URL of those resources ? maybe it's something in the code that build the url.
  3. From your screenshot I can see that you are trying using iOS, do you have the same problem using Android?
  4. In iOS what engine are you using ? try the newest wkengine (https://github.com/apache/cordova-plugin-wkwebview-engine) if you haven't already used it
  5. Have you tried a local server ? something like this https://github.com/apache/cordova-plugins/tree/wkwebview-engine-localhost
Related