Skip to content

Cant find meta on PromiseManyArray #1539

Open
@Techn1x

Description

Which package(s) does this problem pertain to?

  • @types/ember

Maybe others?

What are instructions we can follow to reproduce the issue?

  1. Update to @types/ember 4.0.2 EDIT: This error appeared for me when I updated types/ember to 4.0.2, but the sandbox link below shows the issue and it's on types/ember 3.x, so not sure what's going on
  2. Perform a query, try to access meta key, typescript will say it doesn't exist
const booksResult = await this.store.query('book-library/book', bookSearchQuery)
console.log(booksResult.meta) // Property 'meta' does not exist on type 'ArrayProxy<BookLibraryBook>'
Reproduction Case

I've done my best to create a sandbox here.
https://codesandbox.io/s/my-app-forked-4v11p8?file=/app/routes/index.ts

The sandbox IDE does not show redline errors, but if you open a terminal and type yarn tsc --build you'll see the error

Screenshot from 2022-11-11 13-31-57

Now about that bug. What did you expect to see?

meta property should exist on ArrayProxy and not cause a TS error

What happened instead?

Typescript says meta property does not exist

Screenshot from 2022-11-11 13-03-43
Screenshot from 2022-11-11 13-03-55

Thought I would try a different key update() that was mentioned in an issue that I think might be related?
#1525
Screenshot from 2022-11-11 13-04-22

Metadata

Assignees

No one assigned

    Labels

    types:coreSomething is wrong with the Ember type definitionstypes:core:dataSomething is wrong with the Ember Data type definitions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions