Ionic an minification issue


#1

hey all

I really like Ionic, and it works fine. however if i minificate my application my application fails with this error:

Uncaught Error: [$injector:modulerr] Failed to instantiate module App due to:
Error: [$injector:modulerr] Failed to instantiate module ui.router due to:
Error: [$injector:modulerr] Failed to instantiate module ui.router.state due to:
Error: [$injector:modulerr] Failed to instantiate module ui.router.router due to:
Error: [$injector:unpr] Unknown provider: $urlMatcherFactory

I load the needed modules in my angular application:
angular.module(‘euiApp’, [
‘ui.router’,
‘ionic’,
‘ngAnimate’,
‘ngResource’,
‘ngRoute’,
‘ngSanitize’,
‘ngTouch’

also the index.html file should be fine, using bower:
{
“name”: “app”,
“version”: “0.0.1”,
“dependencies”: {
“angular”: “1.2.21”,
“angular-resource”: “1.2.21”,
“angular-animate”: “1.2.21”,
“angular-sanitize”: “1.2.21”,
“angular-touch”: “1.2.21”,
“angular-route”: “1.2.21”,
“ionic”: “1.0.0-beta.11”,
“angular-ui-router”: “0.2.10”,
“angular-gettext”: “1.0.0”
},
“devDependencies”: {
“angular-mocks”: “1.2.21”,
“angular-scenario”: “1.2.21”
},
“appPath”: “app”
}

any hints what I’m missing?


#2

Hi,

I met the same problem lately. my solution was, exclude the angular-ui-router.js from minification, it should work.
This was happen when i used ionic beta.10.
When I use Ionic beta.11, everything is ok, event using the same ui-router version. bit weird, but at least it work.


#3

thanks for your reply. I use anAnnotate which should explicit support the angular-ui-router, strange.

how did you exclude it from the minification process?

thanks
michu

Edit: I resolved my issue by using ng-annotate (do NOT use ngmin). now it works like a charm, thanks.