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

ember-data 2.14.0: DS.AdapterError.extend no longer working #5020

Closed
urbany opened this issue Jun 19, 2017 · 16 comments
Closed

ember-data 2.14.0: DS.AdapterError.extend no longer working #5020

urbany opened this issue Jun 19, 2017 · 16 comments
Assignees

Comments

@urbany
Copy link

urbany commented Jun 19, 2017

The following code was working on ember-data@2.13.1

import DS from 'ember-data';

export default DS.AdapterError.extend({ message: 'Down for maintenance.' });

I got this from: https://emberjs.com/api/data/classes/DS.AdapterError.html (at the time of this posting the docs are still pointing to TAG: V2.13.0)

And now with ember-data@2.14 I get the following error:
TypeError: _emberData.default.AdapterError.extend is not a function

@lucacorti
Copy link

lucacorti commented Jun 19, 2017

I get the same error on 2.14.1, same use case.

import { AdapterError } from 'ember-data/adapters/errors';

export default AdapterError.extend({
[...]
});

@runspired
Copy link
Contributor

I suspect this is simply another manifestation of #5022 (and #5021 and #5019 )

@urbany
Copy link
Author

urbany commented Jun 20, 2017

@runspired I just tried version 2.14.2 and I got the same error as before: TypeError: _emberData.default.AdapterError.extend is not a function

@runspired
Copy link
Contributor

@urbany tracked this down to the extend is not a function unless the feature flag is configured for it to be on, you likely need to configure it. We may have been improperly failing to strip the feature in the past.

@urbany
Copy link
Author

urbany commented Jun 20, 2017

Ah, thanks @runspired I thought it might be that, but checked the features flag and the default is TRUE, shouldn't it work by default in this case? https://github.com/emberjs/data/blob/v2.14.2/config/features.json

Maybe the docs about the AdapterError should reflect that it is behind a feature flag. https://emberjs.com/api/data/classes/DS.AdapterError.html

@lucacorti
Copy link

I think @urbany is right. The release post for 2.13 also states that ds-extendend-errors is now enabled: https://www.emberjs.com/blog/2017/04/29/ember-2-13-released.html

@runspired
Copy link
Contributor

cc @rwjblue this is looking like an issue with the early defeaturify work.

@rwjblue rwjblue self-assigned this Jun 21, 2017
@rwjblue
Copy link
Member

rwjblue commented Jun 21, 2017

kk, I'll try to dig into it this afternoon

@urbany
Copy link
Author

urbany commented Jul 4, 2017

Hi, sorry to bother you @rwjblue but have you managed to check this? It's preventing us from upgrading to 2.14
Thanks in advance!

@sihuang
Copy link

sihuang commented Jul 11, 2017

I encountered the same issue with 2.13 and have been holding off upgrade since. @rwjblue help much needed. Thanks in advance.

@urbany
Copy link
Author

urbany commented Jul 21, 2017

Just a small update:

If I add this to my config/environment.js

EmberENV.FEATURES['ds-extended-errors'] = true;

It seems to work. Since this feature is supposed to be ON by default there is still a bug here, but if anyone want to start using 2.14 before this is fixed, the code absove should get you going.

Unfortunately I found another bug that is preventing me from upgrading so I'll keep on 2.13 for now.

@sihuang
Copy link

sihuang commented Jul 24, 2017

@urbany Thanks for your update. I can certainly use this workaround for the time being.

@tinyweasel
Copy link

This doesn't work for me on 2.13 or 2.14 and I can't use the canary build, is there a proper fix planned?

@acorncom
Copy link
Contributor

@tinyweasel a number of bugs made there way in in 2.13 as part of refactored done. They are being ironed out, but Ember Data is complicated ...

Looks like there is a pending fix here: #5107

@pangratz
Copy link
Member

pangratz commented Oct 7, 2017

Looks like there is a pending fix here: #5107

For further context, the rebased PR is at #5191

@pangratz
Copy link
Member

Closing as this has been fixed in #5191

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

No branches or pull requests

8 participants