transitionService.js:180 Uncaught TypeError: Cannot read property 'STATE' of undefined
at e._defineCorePaths (transitionService.js:180)
at new e (transitionService.js:73)
at new e (router.js:62)
at y (providers.js:113)
at core.js:9214
at xi (core.js:9168)
at core.js:9099
at new e (core.js:9817)
at Object.Ji [as createNgModuleRef] (core.js:9806)
at t.create (core.js:12337)
Callstack:
// ----------------- Create router -----------------
// Create a new ng2 UIRouter and configure it for ng2
>> var router = new UIRouter();
function UIRouter(locationService, locationConfig) {
if (locationService === void 0) {
locationService = urlService_1.UrlService.locationServiceStub;
}
if (locationConfig === void 0) {
locationConfig = urlService_1.UrlService.locationConfigStub;
}
this.locationService = locationService;
this.locationConfig = locationConfig;
/** @hidden */ this.$id = _routerInstance++;
/** @hidden */ this._disposed = false;
/** @hidden */ this._disposables = [];
/** Provides trace information to the console */
this.trace = trace_1.trace;
/** Provides services related to ui-view synchronization */
this.viewService = new view_1.ViewService();
/** Global router state */
this.globals = new globals_1.UIRouterGlobals();
/** Provides services related to Transitions */
>> this.transitionService = new transitionService_1.TransitionService(this);
var TransitionService = /*@__PURE__*/ (function () {
/** @hidden */
function TransitionService(_router) {
/** @hidden */
this._transitionCount = 0;
/** @hidden The transition hook types, such as `onEnter`, `onStart`, etc */
this._eventTypes = [];
/** @hidden The registered transition hooks */
this._registeredHooks = {};
/** @hidden The paths on a criteria object */
this._criteriaPaths = {};
this._router = _router;
this.$view = _router.viewService;
this._deregisterHookFns = {};
this._pluginapi = common_1.createProxyFunctions(hof_1.val(this), {}, hof_1.val(this), [
'_definePathType',
'_defineEvent',
'_getPathTypes',
'_getEvents',
'getHooks',
]);
>> this._defineCorePaths();
TransitionService.prototype._defineCorePaths = function () {
>> var STATE = interface_1.TransitionHookScope.STATE, TRANSITION = interface_1.TransitionHookScope.TRANSITION;
From the debugger :
interface_1 is defined in the Closure (OEBj) :
After upgrading to angular v6
Fails at runtime :
Callstack:
From the debugger :
interface_1
is defined in the Closure (OEBj) :This is a :
My version of UI-Router is:
1.0.1
&1.1.0
Bug Report
Current Behavior:
Works with
build
withoutbuildOptimizer
:Fail at runtime with
"buildOptimizer": true
:Expected Behavior:
ui-router works with build option:
buildOptimizer: true
Link to Plunker or stackblitz that reproduces the issue:
Repo coming soon
Feature Request
Use UI Router with latest angular version