active-model-adapter icon indicating copy to clipboard operation
active-model-adapter copied to clipboard

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

Open Techn1x opened this issue 1 year ago • 2 comments

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 avatar Nov 24 '23 02:11 Techn1x