Ionic PWA error "can't find config.xml"


#1

Hi.
I’m building an webapp and it’s working fine, the only thing i get is an error saying it can’t find the config.xml.

Here is the error

/config.xml Failed to load resource: the server responded with a status of 404 () cordova.js:1 
[Browser][cordova.js][xhrStatusChangeHandler] Could not XHR config.xml: fail @ cordova.js:1
SplashScreenProxy.js:1 [Browser][cordova.js][xhrStatusChangeHandler] Could not XHR config.xml:

Does someone know why it’s throwing this? I’m hosting the app on Azure.

Thanks.


#2

If you are deploying your Ionic application as a web app, you will need to remove references to Cordova. Out of the box, the templates will reference the Statusbar and Splashscreen plugins. You will want to comment out that code.


#3

Ok i’ll remove everything. Wouldn’t be easier if i remove all plugins? Since i’ll not use them on the web. And even on mobile there’ll be no use for the plugins?
And thanks for your answer.


#4

Hi. Do you mean remove the reference to cordova.js in the index.html?

After taking that out I am getting the following:

> Native: tried calling StatusBar.styleDefault, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
> I @ main.js:1
> main.js:1 Native: tried calling Splashscreen.hide, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
> I @ main.js:1
> main.js:1 Native: tried calling Push.init, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator

#5

That, and the code that calls those two plugins in the app.component.ts file. I see you use a Push plugin, so that will have to be migrated to work in a non-Cordova based environment.


#6

Thanks. Important question is if it really matters. I mean both web app and android app work well. Could I just ignore these warnings?


#7

Correct. You can ignore the warnings. But be aware the Cordova code will NOT run on the web.