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

getURL is not a function #210

Closed
csheppard opened this issue Jun 4, 2016 · 16 comments
Closed

getURL is not a function #210

csheppard opened this issue Jun 4, 2016 · 16 comments

Comments

@csheppard
Copy link

csheppard commented Jun 4, 2016

Hi

I am trying to run fastboot 1.0.0-beta.3 for the first time but I can't get any URLs to load. They all result in this error.

I've not had any luck investigating what the cause of this could be, anybody have any ideas?

Thanks!

$ ember fastboot --serve-assets
Built project successfully. Stored in "dist".
Installing FastBoot npm dependencies
DEBUG: -------------------------------
DEBUG: Ember      : 2.5.1
DEBUG: Ember Data : 2.5.3
DEBUG: -------------------------------
Ember FastBoot running at http://[::]:3000
2016-06-04T19:03:42.785Z 500 Unknown Error: TypeError: _emberMetalProperty_get.get(...).getURL is not a function
    at [object Object].<anonymous> (/src/dist/fastboot/vendor.js:37890:60)
    at Descriptor.ComputedPropertyPrototype.get (/src/dist/fastboot/vendor.js:25318:28)
    at Object.get (/src/dist/fastboot/vendor.js:30918:19)
    at [object Object].ApplicationInstance.reopen.getURL (/src/dist/fastboot/vendor.js:14095:38)
    at Result._finalizeMetadata (/src/node_modules/fastboot/lib/result.js:74:25)
    at Result._finalize (/src/node_modules/fastboot/lib/result.js:64:12)
    at /src/node_modules/fastboot/lib/ember-app.js:225:26
    at tryCatch (/src/dist/fastboot/vendor.js:63911:14)
    at invokeCallback (/src/dist/fastboot/vendor.js:63926:15)
    at publish (/src/dist/fastboot/vendor.js:63894:9)
    at /src/dist/fastboot/vendor.js:42159:7
    at Queue.invokeWithOnError (/src/dist/fastboot/vendor.js:10447:18)
    at Object.Queue.flush (/src/dist/fastboot/vendor.js:10502:11)
    at Object.DeferredActionQueues.flush (/src/dist/fastboot/vendor.js:10310:17)
    at Object.Backburner.end (/src/dist/fastboot/vendor.js:10665:25)
    at Timeout._onTimeout (/src/dist/fastboot/vendor.js:11231:18)
    at tryOnTimeout (timers.js:224:11)
    at Timer.listOnTimeout (timers.js:198:5)
@danmcclain
Copy link
Member

Are you using ember simple auth?

@csheppard
Copy link
Author

Negative, here's my package.json

  "devDependencies": {
    "broccoli-asset-rev": "^2.4.2",
    "ember-cli": "2.5.1",
    "ember-cli-app-version": "^1.0.0",
    "ember-cli-autoprefixer": "0.6.0",
    "ember-cli-babel": "^5.1.6",
    "ember-cli-dependency-checker": "^1.2.0",
    "ember-cli-document-title": "0.3.1",
    "ember-cli-fastboot": "1.0.0-beta.3",
    "ember-cli-fastclick": "1.2.0",
    "ember-cli-head": "0.0.7",
    "ember-cli-html-minifier": "0.1.2",
    "ember-cli-htmlbars": "1.0.8",
    "ember-cli-htmlbars-inline-precompile": "0.3.2",
    "ember-cli-htmlbars-minifier": "0.1.2",
    "ember-cli-inject-live-reload": "^1.4.0",
    "ember-cli-inline-content": "0.4.0",
    "ember-cli-jshint": "1.0.3",
    "ember-cli-qunit": "2.0.2",
    "ember-cli-release": "0.2.8",
    "ember-cli-sass": "5.3.1",
    "ember-cli-sri": "2.1.0",
    "ember-cli-uglify": "^1.2.0",
    "ember-data": "^2.5.3",
    "ember-export-application-global": "^1.0.5",
    "ember-load-initializers": "^0.5.1",
    "ember-radio-button": "1.0.7",
    "ember-resolver": "^2.0.3",
    "ember-websockets": "3.0.0",
    "loader.js": "4.0.7"
  }

@danmcclain
Copy link
Member

Could you try disabling to addons one by one to figure out which one is causing the issue?

@csheppard
Copy link
Author

Ah it seems ember-cli-head was cause... now to figure out why.

@csheppard
Copy link
Author

Further digging has revealed it was a websockets error which I need to make compatible with fastboot anyway.

@piotrekbator
Copy link

@csheppard how exactly was that related to websockets?

I've got the exact same error, and what I found out is that in https://github.com/emberjs/ember.js/blob/master/packages/ember-routing/lib/system/router.js#L148 get(this, 'location') returns "none" instead of—I suppose—NoneLocation. Does anyone now why this could happen?

I'm on Ember (and CLI) 2.6 and Fastboot 1.0.0-beta.4.

@rwjblue
Copy link
Member

rwjblue commented Jun 17, 2016

The string none is changed after boot into an instance of NoneLocation.

@danmcclain
Copy link
Member

If you need the url on the FastBoot side, you can get the information from the fastboot service: https://github.com/ember-fastboot/ember-cli-fastboot#path

@piotrekbator
Copy link

Thanks for answering but those are not my problems. The problematic call to get(this, 'location') originates from FastBoot's Result object in _finalizeMetadata() method (https://github.com/ember-fastboot/fastboot/blob/master/lib/result.js#L74) so that's waaaaay after boot into instance, isn't it?

I've also added breakpoints to each of the places where location on Router is being set an none of them where trapped. So it seems that something in my app (which otherwise works perfectly) prevents the router from replacing "none" with NoneLocation.

I went through the list of my dependencies (below) and none of the addons should be messing around with Router. Removing one by one will be very tedious (given how extremly slow npm is) but if that's the only way to debug this, I can give it a try. Is it? Or maybe you've seen such problem in some circumstances?

Dependencies:

{
  "active-model-adapter": "~>2.0",
  "broccoli-asset-rev": "^2.4.2",
  "ember-ajax": "^2.0.1",
  "ember-api-actions": "0.1.4",
  "ember-cli": "2.6.1",
  "ember-cli-app-version": "^1.0.0",
  "ember-cli-autoprefixer": "0.6.0",
  "ember-cli-babel": "^5.1.6",
  "ember-cli-dependency-checker": "^1.2.0",
  "ember-cli-font-awesome": "0.1.1",
  "ember-cli-google-analytics": "1.5.0",
  "ember-cli-head": "0.0.7",
  "ember-cli-htmlbars": "^1.0.3",
  "ember-cli-htmlbars-inline-precompile": "^0.3.1",
  "ember-cli-infinite-scroll": "0.4.2",
  "ember-cli-inject-live-reload": "^1.4.0",
  "ember-cli-jshint": "^1.0.0",
  "ember-cli-qunit": "^1.4.0",
  "ember-cli-release": "0.2.8",
  "ember-cli-sass": "^5.0.0",
  "ember-cli-sri": "^2.1.0",
  "ember-cli-uglify": "^1.2.0",
  "ember-data": "^2.6.0",
  "ember-export-application-global": "^1.0.5",
  "ember-form-builder": "1.1.1",
  "ember-group-by": "0.0.3",
  "ember-i18n": "^4.1.1a",
  "ember-ic-you": "0.1.3",
  "ember-load-initializers": "^0.5.1",
  "ember-page-title": "3.0.2",
  "ember-resolver": "^2.0.3",
  "ember-truth-helpers": "1.2.0",
  "ember-validations": "git://github.com/nibynic/ember-validations",
  "jquery.scrollto": "2.1.2",
  "loader.js": "^4.0.1"
}

@piotrekbator
Copy link

Well, it really is somehow related to websockets. When I comment out the code that initiates socket.io connection it works OK. As soon as I try connecting via websockets, the error comes back. It's really weird as this is not some weird addon that messes up with Ember internals but just the socket.io library.

@techsoldaten
Copy link

I am running into the same issue using fastboot with the latest version of Ember. Not using Websockets or anything, just a normal router call.

Built project successfully. Stored in "dist".
Installing FastBoot npm dependencies
DEBUG: -------------------------------
DEBUG: Ember      : 2.6.1
DEBUG: Ember Data : 2.6.1
DEBUG: -------------------------------
Ember FastBoot running at http://[::]:3000
2016-06-30T05:00:01.592Z 500 Unknown Error: TypeError: _emberMetalProperty_get.get(...).getURL is not a function
    at [object Object].<anonymous> (/ember/public/dist/fastboot/vendor.js:37104:60)

Dependencies:

  "devDependencies": {
    "broccoli-asset-rev": "^2.4.2",
    "ember-ajax": "0.7.1",
    "ember-cli": "^2.6.2",
    "ember-cli-app-version": "^1.0.0",
    "ember-cli-autoprefixer": "0.6.0",
    "ember-cli-babel": "^5.1.6",
    "ember-cli-dependency-checker": "^1.2.0",
    "ember-cli-document-title": "0.3.1",
    "ember-cli-fastboot": "1.0.0-beta.4",
    "ember-cli-google-fonts": "2.3.0",
    "ember-cli-htmlbars": "^1.0.3",
    "ember-cli-htmlbars-inline-precompile": "^0.3.1",
    "ember-cli-inject-live-reload": "^1.4.0",
    "ember-cli-jshint": "^1.0.0",
    "ember-cli-meta-tags": "1.0.2",
    "ember-cli-mirage": "0.2.1",
    "ember-cli-qunit": "^1.4.0",
    "ember-cli-release": "0.2.8",
    "ember-cli-reset-scroll": "0.0.1",
    "ember-cli-sass": "^5.3.1",
    "ember-cli-sri": "^2.1.0",
    "ember-cli-sticky": "0.6.0",
    "ember-cli-swiper": "^0.3.0",
    "ember-cli-uglify": "^1.2.0",
    "ember-composable-helpers": "0.26.2",
    "ember-data": "2.6.1",
    "ember-disqus": "0.2.0",
    "ember-export-application-global": "^1.0.5",
    "ember-font-awesome": "2.1.1",
    "ember-highlight-code": "0.0.8",
    "ember-impagination": "0.2.0",
    "ember-in-viewport": "2.0.7",
    "ember-infinity": "0.2.3",
    "ember-islands": "1.0.0",
    "ember-lazy-image": "0.0.15",
    "ember-link-action": "0.0.34",
    "ember-load-initializers": "^0.5.1",
    "ember-resolver": "^2.0.3",
    "ember-responsive": "1.2.6",
    "ember-route-action-helper": "0.3.2",
    "ember-scroll-to": "0.5.1",
    "ember-stagger-swagger": "^1.0.12",
    "ember-text-placeholder": "0.6.1",
    "ember-truth-helpers": "1.2.0",
    "liquid-fire": "0.23.0",
    "loader.js": "^4.0.1",
    "node-gyp": "^3.3.1",
    "node-sass": "~3.7.0",
    "watchman": "^0.1.8"
  },

@danmcclain
Copy link
Member

@techsoldaten What's the export that contains line 37104 in dist/fastboot/vendor.js?

@techsoldaten
Copy link

@vlascik
Copy link
Contributor

vlascik commented Jul 8, 2016

@techsoldaten, @piotrekbator: I had the same problem in fastboot-app-server, even though the app was working fine in ember fastboot. I noticed fastboot-app-server is using older fastboot and fastboot-express-middleware, so I updated them to the same versions as in ember-cli: 2.7.0-beta.5, which fixed the problem.
I suspect you are using cli with older fastboot as well. Maybe try to update to the latest version.

@danmcclain
Copy link
Member

Lets continue conversation on the open issue, as it seems related: #223

@ember-fastboot ember-fastboot locked and limited conversation to collaborators Jul 8, 2016
@danmcclain
Copy link
Member

Locked to encourage converging discussion on single issue

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

No branches or pull requests

6 participants