Skip to content

Typescript type for the core-data store and notices store are returned as any #73844

Closed

Description

@mikeybinns

Description

When using the wp-6.8 version of the core-store package, the store variable had the types of all the actions and selectors, so when using it in useSelect for example, the types were correctly set.

However, on updating to wp-6.9, these types seem to have broken and are returning any to my project. I can see the type is set correctly when inspecting the package, it's only when importing the package that this breaks.

This could be an issue in core-data package or the data package as it seems to be linked. See my steps to reproduce below. For some reason, if you don't explicitly install the package, it shows the type as any, but if you do, it shows as the correct type. Note sure why this happens because the package version is the same and is added to the same place in node_modules.

EDIT:
I've noticed that this also happens with the @wordpress/notices package in exactly the same way.

Before:

In my file:
Image

The export in the package:
Image

After:
In my file:
Image
The export in the package:
Image

Step-by-step reproduction instructions

Not sure if applicable, but I'm using Node v20.19.6, NPM 10.8.2 and TypeScript 5.9.3 (built in with VSCode 1.106)

  1. Create fresh folder
  2. run npm init --yes
  3. Install only core data package at tagged wp-6.8 version npm i --save-exact -D @wordpress/core-data@wp-6.8
  4. Create index.ts file, add import { store } from "@wordpress/core-data"; to it.
  5. Hover over "store" in the editor to see the type (any)
  6. Install data package at tagged wp-6.8 version npm i --save-exact -D @wordpress/data@wp-6.8
  7. Hover over "store" in the editor to see the type (correct type now)
  8. Update both packages to tagged wp-6.9 version npm i --save-exact -D @wordpress/core-data@wp-6.9 @wordpress/data@wp-6.9
  9. Hover over "store" in the editor to see the type (any)

Screenshots, screen recording, code snippet

No response

Environment info

Node v20.19.6, NPM 10.8.2 and TypeScript 5.9.3 (built in with VSCode 1.106)
MacOS 26.1 Tahoe
wp-6.8
@wordpress/core-data -> 7.19.6
@wordpress/data -> 10.19.2
wp-6.9
@wordpress/core-data -> 7.33.8
@wordpress/data -> 10.33.1

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. added
    [Type] BugAn existing feature does not function as intended
    on Dec 9, 2025
  2. changed the title [-]Typescript type for the core store is returned as any[/-] [+]Typescript type for the core-data store and notices store are returned as any[/+] on Dec 9, 2025
  3. Mamaduka commented on Jan 9, 2026

    @Mamaduka
    Member

    The notices packages don't have types yet, which should be fixed via #67670. Props to @manzoorwanijk

  4. manzoorwanijk commented on Aug 31, 2026

    @manzoorwanijk
    Member

    This should now be fixed with the above PR merged. Feel free to reopen if you still face the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended[Type] Code QualityIssues or PRs that relate to code quality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions