-
Notifications
You must be signed in to change notification settings - Fork 158
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
_emberMetalProperty_get.get(...).getURL is not a function #223
Comments
@IAmJulianAcosta it seems my issue is similar to yours (#209). Do you think so too? |
Yes, is a very similar issue. |
@IAmJulianAcosta do you have an idea how we could create a pull request which fixes this problem? I'm still not sure what our exact problem is. I think the problem is that the stack trace is misleading and that an error which is caught still causes a crash later on. Do you think it is better to first prevent the app from crashing at all and then focusing on the stack trace? |
I have to recreate the problem again to fix it, but I damaged the VM where I was working with fastboot. Fortunately I documented well this problem and I'll be able to recreate again easily. I'll get in touch with you in ember chat when I have some spare time and we could fix it. |
When an uncaught exception occurs within an instance initializer, the application instance never finishes setting up and so Where this begins to show itself is inside the lib/ember-app visit method. The error is handled by assigning it to For those stuck, I suggest putting a breakpoint here or logging to the console |
This is exactly what I've been doing 😉 I think the problem is, that it is super hard to debug (if you don't know all the internals of Ember and Fastboot). I got stuck setting up fastboot for about a week because I always thought it is a problem with Ember Simple Auth. So I was searching for the bug in a spot where it never occurred. I tried to create a pull request but I'm also not sure how to fix this. Especially because I'm not an expert with all the Ember and Fastboot internals. |
Accessing it if the instance failed to boot causes Ember's router to try and access `location.getURL` when `location` is a string (`"none"`) instead the expected `Ember.NoneLocation` instance. This is leading to all uncaught errors that occur during the app boot to be masked/swallowed. ember-fastboot/ember-cli-fastboot#223
ember-fastboot/fastboot#71 fixes the issue |
What is the current state of this? I seem to be running into it while switching to fastboot. |
Also seeing this in my acceptance tests as of Ember 2.13.2 but I am not using FastBoot. |
Same. Running in acceptance tests for ember 2.12.1 but not using FastBoot. |
Same issue while running unit tests for ember 2.14. is there any work around? |
Can someone provide a minimal reproduction? |
Same Issue here.... Running in acceptance tests for ember 2.17 |
I've been having this error in acceptance tests, unrelated to FastBoot. The cause of the problem was that I was missing |
I've been having this error in model tests, unrelated to FastBoot @lolmaus's unfortunately suggested fix isn't applicable for my case. |
@amk221 That's weird. Model tests are integration tests, I assume the URL should not be involved in any way. Can you post your test to https://gist.github.com ? |
@amk221 You have a number of issues with your test:
I've filed a pull request addressing these and the test is green: https://github.com/amk221/-ember-data-geturl-not-a-function/pull/1/files That said, the error Metaphorically speaking, the framework should produce a gag reflex and refuse to swallow a large object. Instead, it swallows the object obediently and dies from intestine blockage. |
The actual test does some setting and unsetting of relationships. But still comes back with this error. However - I've just put two and two together, and I now think that it's related to this issue: i.e. Setting the relationship from null back to an ED model does not work due to the above bug in 5517, therefore, the test ends up I've just tried |
When there is an error in an instance-initializer a very unhelpful exception is thrown. You will get the following stacktrace:
The real error is kind of "swallowed" and very very hard to find. What happens behind the scene is the following:
The error is kind of caught in a promise and the reject callback in
rsvp/-internal
is called. This happens ininitializePromise
withreject(promise, e)
for more details see the screenshot of the stack trace. At this point the correct error is "caught"If you continue to step through the program there is going on a lot behind the scenes, like flushing the queues etc. At the end
fastboot/lib/result.js
calls the_finalize
method and then_finalizeMetadata
._finalizeMetadata
callsinstance.getURL()
and then for some reason getURL does not work because it is undefined. If there is no error during instance initializing then the stack trace looks almost the same andinstance.getURL()
works as expected.The main problem with this issue is, that the stack trace to
_emberMetalProperty_get.get(...).getURL is not a function
is totally misleading. I digged around in all of the dependencies because the stack trace never pointed to my own source files and I was really lost. It was just coincidence that I had a break point inrsvp/-internal
at thereject
callback. I'm not sure if it is a bug but it makes getting fastboot to work really hard.Steps to reproduce:
mkdir fastboot-tryout cd fastboot-tryout/ ember init ember install ember-cli-fastboot ember g instance-initializer make-fastboot-fail vi app/instance-initializers/make-fastboot-fail.js
write something like the following into make-fastboot-fail.js
Then execute the following commands:
After that you should see the exception from the beginning of my post. For more details I attached my package.json and bower.json
package.txt
bower.txt
The text was updated successfully, but these errors were encountered: