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

Uncaught TypeError: t.map is not a function #27

Open
bobbingwide opened this issue Sep 25, 2023 · 4 comments
Open

Uncaught TypeError: t.map is not a function #27

bobbingwide opened this issue Sep 25, 2023 · 4 comments

Comments

@bobbingwide
Copy link
Owner

Uncaught TypeError: t.map is not a function
    at qo (templates.js:53:18)
    at actions.js:53:13
    at thunk-middleware.js:4:11
    at index.js:24:12
    at promise-middleware.js:20:9
    at Object.dispatch (resolvers-cache-middleware.js:51:10)
    at index.js:202:29
    at index.js:85:4
    at Ug (react-dom.js?ver=18:1:207718)
    at Ag (react-dom.js?ver=18:1:209328)
react-dom.js?ver=18:1 

The above error occurred in one of your React components:

at https://blocks.wp.a2z/wp-content/plugins/gutenberg/build/editor/index.min.js?ver=96588d786d072613d4c6:56:3358
at https://blocks.wp.a2z/wp-content/plugins/gutenberg/build/editor/index.min.js?ver=96588d786d072613d4c6:48:734
at WithRegistryProvider(Component)
at qd (https://blocks.wp.a2z/wp-content/plugins/gutenberg/build/components/index.min.js?ver=3426334688a22e73bc0c:1:202446)
at Yd (https://blocks.wp.a2z/wp-content/plugins/gutenberg/build/components/index.min.js?ver=3426334688a22e73bc0c:1:202572)
at Jd (https://blocks.wp.a2z/wp-content/plugins/gutenberg/build/components/index.min.js?ver=3426334688a22e73bc0c:1:204255)
at div
at x (https://blocks.wp.a2z/wp-content/plugins/gutenberg/build/keyboard-shortcuts/index.min.js?ver=cb5377c7040e7e246fc0:1:3493)
at qa (https://blocks.wp.a2z/wp-content/plugins/gutenberg/build/edit-post/index.min.js?ver=feeab9feeb4fa9cd8a33:47:2502)

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.

Originally posted by @bobbingwide in bobbingwide/bobbingwide#104 (comment)

@bobbingwide
Copy link
Owner Author

The problem is associated with the oik-types plugin and CPTs which implement the template argument,
where the CPT has been modified in oik-type's admin interface.

The CPTs which could have been affected were:

  • oik-plugins
  • block
  • oik-pluginversion

The workaround is to delete the overridden CPT entries in oik-types admin ( Types > Types ).

@bobbingwide
Copy link
Owner Author

This problem first occurred in blocks.wp.a2z then blocks.wp-a2z.org
where a similar change had been made to the definition of the CPTs.

@bobbingwide bobbingwide transferred this issue from bobbingwide/bobbingwide Sep 25, 2023
@bobbingwide
Copy link
Owner Author

bobbingwide commented Dec 15, 2023

It happened again in wp-secrets.co.uk where I removed "Display in blog home page" from post type supports for oik-plugins.

@bobbingwide
Copy link
Owner Author

The problem was in bw_update_post_type which was changing the template from an array to an stdObject.
It needs to remain as an array.

While investigating the fix I wrote some code to display an excerpt of the template when editing a CPT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant