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

Cannot read properties of undefined (reading 'store') #63006

Closed
mxvsh opened this issue Jul 1, 2024 · 5 comments
Closed

Cannot read properties of undefined (reading 'store') #63006

mxvsh opened this issue Jul 1, 2024 · 5 comments
Labels
Needs Testing Needs further testing to be confirmed. [Package] Core data /packages/core-data [Status] Needs More Info Follow-up required in order to be actionable. [Type] Bug An existing feature does not function as intended

Comments

@mxvsh
Copy link

mxvsh commented Jul 1, 2024

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

  1. Install @wordpress/core-data
  2. Add following code
import { store } from '@wordpress/core-data';
console.log('store', store);
  1. You should get an error.

Screenshots, screen recording, code snippet

Code:

Screenshot 2024-07-01 at 14 00 23

Result:

Screenshot 2024-07-01 at 13 58 04

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

@mxvsh mxvsh added the [Type] Bug An existing feature does not function as intended label Jul 1, 2024
@akasunil akasunil added the [Package] Core data /packages/core-data label Jul 1, 2024
@Mamaduka Mamaduka added the Needs Testing Needs further testing to be confirmed. label Jul 14, 2024
Copy link

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Aug 14, 2024
@miminari
Copy link
Member

Thank you for reporting.
I tested this on WordPress 6.6.1, and I wasn't be able to reproduced, doing like below steps:

  1. npx @wordpress/create-block@latest error-test
  2. cd error-test
  3. npx @wp-now/wp-now start --reset
  4. Change the files to Typescript(index.ts, edit.tsx, save.tsx) , Add tsconfig.json and npm i -D @types/wordpress__blocks @types/wordpress__block-editor
  5. Add the code on edit.tsx
  6. npm run start

SS_2024-08-14 10 55 22

It seems to work nice probably.

@github-actions github-actions bot removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Aug 15, 2024
Copy link

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Sep 14, 2024
@miminari
Copy link
Member

miminari commented Oct 2, 2024

@mxvsh Hi, if you can share more details, please tell us about that.

@miminari miminari added [Status] Needs More Info Follow-up required in order to be actionable. and removed [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. labels Oct 2, 2024
@miminari
Copy link
Member

@mxvsh I would like to close this issue, but if there is anything I have missed, please feel free to comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Testing Needs further testing to be confirmed. [Package] Core data /packages/core-data [Status] Needs More Info Follow-up required in order to be actionable. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants