gutenberg
gutenberg copied to clipboard
Cannot read properties of undefined (reading 'store')
Description
Package @wordpress/core-data
isn't working. It returns undefined when I try to import it in a TypeScript project.
Here's ny TSConfig
{
"compilerOptions": {
"jsx": "react-jsx",
"module": "ESNext",
"target": "ES2016",
"strict": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "node"
}
}
Step-by-step reproduction instructions
- Install
@wordpress/core-data
- Add following code
import { store } from '@wordpress/core-data';
console.log('store', store);
- You should get an error.
Screenshots, screen recording, code snippet
Code:
Result:
Environment info
- Wordpress Version: 6.5.5
- I am building a custom theme (Clone of 2024)
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