Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.13.0+ - router property undefined #15235

Closed
jamesdixon opened this issue May 11, 2017 · 8 comments
Closed

2.13.0+ - router property undefined #15235

jamesdixon opened this issue May 11, 2017 · 8 comments

Comments

@jamesdixon
Copy link

Hi,

I've just upgraded my app from 2.12.2 to 2.13.0 and am receiving the following errors when loading the app:

TypeError: Cannot read property '_scheduleLoadingEvent' of undefined
    at willResolveModel (ember.debug.js:30811)
    at Router.triggerEvent (ember.debug.js:30998)
    at trigger (ember.debug.js:47570)
    at Transition.trigger (ember.debug.js:48112)
    at C.runBeforeModelHook (ember.debug.js:48289)
    at ember.debug.js:47555
    at tryCatch (ember.debug.js:50182)
    at invokeCallback (ember.debug.js:50197)
    at publish (ember.debug.js:50165)
    at ember.debug.js:40857
TypeError: Cannot read property '_markErrorAsHandled' of undefined
    at Router.triggerEvent (ember.debug.js:30990)
    at trigger (ember.debug.js:47570)
    at Transition.trigger (ember.debug.js:48112)
    at ember.debug.js:47920
    at tryCatch (ember.debug.js:50182)
    at invokeCallback (ember.debug.js:50197)
    at publish (ember.debug.js:50165)
    at publishRejection (ember.debug.js:50100)
    at ember.debug.js:40857
    at invokeWithOnError (ember.debug.js:2197)

When digging into the error a bit more, it appears that the router property isn't defined, which is what's causing the error. For example:

    willResolveModel: function (transition, originRoute) {
      originRoute.router._scheduleLoadingEvent(transition, originRoute);
    }

router is not defined here.

I've also tried Ember 2.14.0-beta.x, but no luck. All works fine in 2.12.x.

Here are my dependencies from package.json for reference:

"babel-eslint": "^7.2.3",
    "broccoli-asset-rev": "^2.5.0",
    "broccoli-funnel": "^1.2.0",
    "dotenv": "4.0.0",
    "ember-ajax": "3.0.0",
    "ember-braintree-components": "0.1.0",
    "ember-browserify": "1.1.13",
    "ember-buffered-proxy": "0.7.0",
    "ember-cli": "^2.13.1",
    "ember-cli-accounting": "2.0.1",
    "ember-cli-animate-css": "0.0.1",
    "ember-cli-app-version": "^3.0.0",
    "ember-cli-babel": "^6.1.0",
    "ember-cli-bourbon": "1.2.2",
    "ember-cli-chartist": "^1.2.0",
    "ember-cli-cors": "0.0.2",
    "ember-cli-dependency-checker": "^1.4.0",
    "ember-cli-deploy": "^1.0.0",
    "ember-cli-deploy-scout-pack": "1.2.0",
    "ember-cli-dotenv": "^1.2.0",
    "ember-cli-eslint": "~3.1.0",
    "ember-cli-flash": "1.4.2",
    "ember-cli-htmlbars": "^2.0.1",
    "ember-cli-htmlbars-inline-precompile": "^0.4.3",
    "ember-cli-inject-live-reload": "^1.6.1",
    "ember-cli-intercom": "0.4.0",
    "ember-cli-jwt-decode": "0.0.3",
    "ember-cli-moment-shim": "3.1.0",
    "ember-cli-photoswipe": "1.2.0",
    "ember-cli-qunit": "^4.0.0",
    "ember-cli-release": "^1.0.0-beta.2",
    "ember-cli-rollbar": "0.3.0",
    "ember-cli-sass": "6.1.3",
    "ember-cli-shims": "1.1.0",
    "ember-cli-sri": "^2.1.1",
    "ember-cli-string-helpers": "1.2.1",
    "ember-cli-test-loader": "^2.1.0",
    "ember-cli-uglify": "^1.2.0",
    "ember-component-css": "0.3.3",
    "ember-composable-helpers": "2.0.1",
    "ember-cpm": "2.1.3",
    "ember-concurrency": "^0.8.3",
    "ember-cp-validations": "3.3.1",
    "ember-data": "^2.13.1",
    "ember-data-model-fragments": "2.11.3",
    "ember-data-route": "0.2.0",
    "ember-export-application-global": "^2.0.0",
    "ember-font-awesome": "3.0.5",
    "ember-fullcalendar": "1.7.0",
    "ember-group-by": "0.0.3",
    "ember-inflector": "2.0.0",
    "ember-leaflet": "^3.0.11",
    "ember-leaflet-tiles-cache": "0.1.1",
    "ember-light-table": "1.8.6",
    "ember-load-initializers": "^1.0.0",
    "ember-local-storage": "1.3.6",
    "ember-lodash": "4.17.2",
    "ember-math-helpers": "2.1.0",
    "ember-metrics": "^0.10.0",
    "ember-moment": "7.3.0",
    "ember-paper": "^1.0.0-alpha.19",
    "ember-paper-stepper": "0.0.5",
    "ember-paper-swiper": "0.0.3",
    "ember-place-autocomplete": "0.0.17",
    "ember-power-calendar": "0.5.0",
    "ember-power-select": "1.8.4",
    "ember-promise-helpers": "^1.0.3",
    "ember-resolver": "^4.1.0",
    "ember-responsive": "^2.0.2",
    "ember-route-action-helper": "2.0.3",
    "ember-run-decorators": "0.0.1",
    "ember-simple-auth": "1.3.0",
    "ember-simple-auth-token": "2.1.0",
    "ember-tether": "0.4.1",
    "ember-source": "2.12.2",
    "ember-timepicker": "0.2.0",
    "ember-tooltips": "2.8.2",
    "ember-transition-helper": "0.0.6",
    "ember-truth-helpers": "1.3.0",
    "ember-wormhole": "0.5.1",
    "eslint-config-ember": "0.3.0",
    "eslint-plugin-ember-suave": "^1.0.0",
    "ivy-tabs": "3.1.0",
    "leaflet": "^1.0.3",
    "loader.js": "^4.4.0",
    "lodash": "^4.17.4",
    "moment": "2.18.1",
    "moment-timezone": "0.5.13",
    "money-math": "^2.5.0",
    "node-zopfli": "2.0.2"

Thanks in advance!

@Serabe
Copy link
Member

Serabe commented May 12, 2017

I cannot reproduce because some of the addons you use require configuration. Can you please provide a twiddle or a repo with a reproduction?

Thank you!

@locks
Copy link
Contributor

locks commented May 12, 2017

I don't understand where your code above is, but I'm going to assume this problem is related to Ember.Router.router changing names to Ember.Router.routerMicroLib in #14919.

@Serabe
Copy link
Member

Serabe commented Jun 1, 2017

@jamesdixon ping!

@stefanpenner
Copy link
Member

left a comment -> #14919 (comment)

@Serabe
Copy link
Member

Serabe commented Jul 3, 2017

@stefanpenner as I understand, router is deprecate in that PR. Given there is no further information, I'm closing the issue according to the CONTRIBUTING document.

Thank you all!

@Serabe Serabe closed this as completed Jul 3, 2017
@jamesdixon
Copy link
Author

Hi all, sorry for not replying to this sooner. I'm just getting another opportunity to try and update dependencies for our application and still running into this issue.

@Serabe I'll work on a Twiddle to see if I can't reproduce.

@locks it's coming from here: https://github.com/emberjs/ember.js/blob/master/packages/ember-routing/lib/system/router.js#L1113

It seems like a core router method, so I'm unsure what would be affecting it. If anyone has any tips on tracking this down, I'd certainly appreciate it 👍

@jamesdixon
Copy link
Author

For what it's worth, this was being caused by me having an error action in my application route.

@rwjblue
Copy link
Member

rwjblue commented Oct 14, 2017

Just FYI, I fixed a fairly gnarly bug in that very code recently. Essentially, there were a number of scenarios that would have attempted to access .router as a property on the arguments to the default action handlers unconditionally. I refactored away from that (and added tests for the scenario that I had ran into).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants