Ionic v4 isn't working for windows platform

Has ionic stopped producing for the windows platform in ionic v4?

I created a new ionic app using --type=angular.

After this I did the usual to make this build on the windows platform - I’m trying to build on visual studio 2017 on the universal windows platform.

The bug is that it gives me a blank screen which seems like it’s not calling the right js files or it isn’t all together to be used on the windows platform yet?

I run the same steps I do for this v4 on v3 with --type=ionic-angular and the normal v3 and the windows platform works fine.

steps to reproduce:

  1. on npm run ionic start myApp tabs --type=angular
  2. I add the help it provides for ios and android.
  3. I open this file using visual code and navigate to config.xml
  4. in this I add <preference name=“windows-target-version” value=“10.0” />
  5. Then in the cmd or the intregated terminal type in ionic cordova platform add windows
  6. then again in the cmd or terminal type in ionic cordova build windows
  7. this will produce a directory called platforms, inside another directory called windows.
  8. inside of the windows folder, there is a cordovaapp.sln file which i open up in vs 2017
  9. from there it gives me a blank screen using ionic v4 but in ionic v3 it works fine with the app working.

I would to just know if ionic are still supporting windows? My company is trying to intregate the windows platform so that answer would be very helpful.

I’ve found a solution! Navigating into the www directory and then going into the index.html that lives inside of there. I change the < base href="/" > to this < base href="./" > and this now allows all of the javascript files to be found and runs on the browser and on windows platform 10. We also checked routing and page loads and everything should be ok. It seems like there is a issue of directories going on.


Don’t edit files in the www folder.

Change the index.html that is outside of the www folder.

The www folder is managed by the build process

You can also just get rid of the base href entirely.
Just activate useHash in the AppRouter and your all set.

    imports: [RouterModule.forRoot(routes, {useHash: true})],
    exports: [RouterModule]
export class AppRoutingModule {

Then you’re back to the ionic 3 navigation with the /#/home

1 Like

Thanks for your solution @hasin1996 , it works!
Is there an issue regarding this somewhere on the Ionic GitHub page? This should really be fixed.

I posted this issue on the ionic 4 github page and they closed it saying it was a cordova issue :frowning:

1 Like

Thank you so much! I have already lost 2 days on this problem. You saved me at least two more! :wink: :sunny: :blush:

This issue has taken 3 days of my time. Still not fixed. Need ionic or cordova this counted to solve.

Thank-you this also fixed it for me!!
I did of course edit the src/index.html rather than the on in the www.

Great answer. Solve my problem too. Thanks