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

Fix ember-data 5.0 warning, use local copy of errorsHashToArray #188

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Techn1x
Copy link

@Techn1x Techn1x commented Nov 24, 2023

Building an application with ember-data 5 and this addon results in this warning;

WARNING in ../rewritten-packages/active-model-adapter.621d47ca/active-model-adapter.js 172:21-38
export 'errorsHashToArray' (imported as 'errorsHashToArray') was not found in '@ember-data/adapter/error' (possible exports: AbortError, ConflictError, ForbiddenError, InvalidError, NotFoundError, ServerError, TimeoutError, UnauthorizedError, default)
 @ ../rewritten-packages/active-model-adapter.621d47ca/index.js 1:0-56 3:15-33 4:0-53
 @ ./assignment/adapter.js 7:0-54 40:66-84
 @ ./tests/co-located/assignment/adapter-test.js 3:0-75 14:16-35 25:16-35 36:16-35 47:16-35
 @ ./assets/test.js 193:13-85

As mentioned in the deprecation, errorsHashToArray is dropped in ember-data 5
https://deprecations.emberjs.com/ember-data/v4.x/#toc_ember-data-deprecate-errors-hash-to-array-helper

The recommendation is to replace it with a local copy

Users making use of these (already private) utilities can trivially copy them into their own codebase to continue using them

@Techn1x
Copy link
Author

Techn1x commented Nov 24, 2023

cc @mfeckie

@olenderhub
Copy link

@Techn1x it works for me, thank you.

@jherdman
Can you merge this?

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

Successfully merging this pull request may close these issues.

2 participants