Why doesn’t my Ionic app run in the browser?

Asked

Viewed 735 times

0

I made an app with Ionic and runs perfectly using command ionic serve. But when I try to run it in the browser it doesn’t work right, why this?

When running the app in the browser the following warning appears on the console:

Uncaught Syntaxerror: Unexpected token < (index):1

And that’s just one of the problems. The login validation, for example, if I put a different login does not show the message I put "Invalid e-mail or password"! You are entering the app smoothly.

  • 1

    Are you using some Cordova plugin in the project? If it is only going to work on mobile even, in the browser some function will not be possible.

  • As the friend André Vicente said, if you use some functions of Cordova it will only work if you are in a mobile environment and/ or emulating with Ionic serves. I have no idea how these frameworks can make calls to native functions, but I believe it’s through a [Javascriptinterface][1] that enables you to make these calls (I don’t know, it’s just a hunch), and if that’s right, this interface won’t exist in the web environment (as I said, it’s a hunch) [1]: http://developer.android.com/intl/pt-br/reference/android/webkit/JavascriptInterface.html

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.