WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.51k stars 4.2k forks source link

Multiple console errors when using Block Inserter #51403

Closed Sidsector9 closed 1 year ago

Sidsector9 commented 1 year ago

Partially related to #44320

Description

When using block inserter (one on the top-left of the block editor) to search for a block, multiple console errors are logged once the patters start to load.

Step-by-step reproduction instructions

  1. Create a page
  2. Use the block inserter (one on the top left of the editor)
  3. Search for a block (for example Image)
  4. Scroll the results
  5. Observe for console errors

Screenshots, screen recording, code snippet

https://github.com/10up/block-components/assets/17757960/a3c9ebc5-6c15-46b6-8dc5-d9331c232918

Environment info

### wp-core ### version: 6.2.2 site_language: en_US user_language: en_US timezone: +00:00 permalink: undefined https_status: false multisite: false user_registration: 0 blog_public: 1 default_comment_status: open environment_type: local user_count: 1 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /var/www/html wordpress_size: loading... uploads_path: /var/www/html/wp-content/uploads uploads_size: loading... themes_path: /var/www/html/wp-content/themes themes_size: loading... plugins_path: /var/www/html/wp-content/plugins plugins_size: loading... database_size: loading... total_size: loading... ### wp-active-theme ### name: Twenty Twenty-Three (twentytwentythree) version: 1.1 author: the WordPress team author_website: https://wordpress.org parent_theme: none theme_features: core-block-patterns, post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links, block-templates, widgets-block-editor theme_path: /var/www/html/wp-content/themes/twentytwentythree auto_update: Disabled ### wp-themes-inactive (12) ### Twenty Eleven: version: 4.3, author: the WordPress team, Auto-updates disabled Twenty Fifteen: version: 3.4, author: the WordPress team, Auto-updates disabled Twenty Fourteen: version: 3.6, author: the WordPress team, Auto-updates disabled Twenty Nineteen: version: 2.5, author: the WordPress team, Auto-updates disabled Twenty Seventeen: version: 3.2, author: the WordPress team, Auto-updates disabled Twenty Sixteen: version: 2.9, author: the WordPress team, Auto-updates disabled Twenty Ten: version: 3.8, author: the WordPress team, Auto-updates disabled Twenty Thirteen: version: 3.8, author: the WordPress team, Auto-updates disabled Twenty Twelve: version: 3.9, author: the WordPress team, Auto-updates disabled Twenty Twenty: version: 2.2, author: the WordPress team, Auto-updates disabled Twenty Twenty-One: version: 1.8, author: the WordPress team, Auto-updates disabled Twenty Twenty-Two: version: 1.4, author: the WordPress team, Auto-updates disabled ### wp-plugins-inactive (4) ### Example Plugin: version: 0.1.0, author: 10up, Auto-updates disabled Hello Dolly: version: 1.7.2, author: Matt Mullenweg, Auto-updates disabled WP Debugging: version: 2.11.21, author: Andy Fragen (latest version: 2.11.22), Auto-updates disabled Yoast SEO: version: 20.4, author: Team Yoast (latest version: 20.8), Auto-updates disabled ### wp-media ### image_editor: WP_Image_Editor_Imagick imagick_module_version: 1691 imagemagick_version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org imagick_version: 3.6.0 file_uploads: File uploads is turned off post_max_size: 8M upload_max_filesize: 2M max_effective_size: 2 MB max_file_uploads: 20 imagick_limits: imagick::RESOURCETYPE_AREA: 122 MB imagick::RESOURCETYPE_DISK: 1073741824 imagick::RESOURCETYPE_FILE: 786432 imagick::RESOURCETYPE_MAP: 512 MB imagick::RESOURCETYPE_MEMORY: 256 MB imagick::RESOURCETYPE_THREAD: 1 imagick::RESOURCETYPE_TIME: 9.2233720368548E+18 imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DNG, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, H, HALD, HDR, HEIC, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPG, MRW, MSL, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMV, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV gd_version: bundled (2.1.0 compatible) gd_formats: GIF, JPEG, PNG, WebP, BMP ghostscript_version: 9.53.3 ### wp-server ### server_architecture: Linux 5.10.104-linuxkit x86_64 httpd_software: Apache/2.4.56 (Debian) php_version: 8.0.29 64bit php_sapi: apache2handler max_input_variables: 1000 time_limit: 30 memory_limit: 128M admin_memory_limit: 256M max_input_time: -1 upload_max_filesize: 2M php_post_max_size: 8M curl_version: 7.74.0 OpenSSL/1.1.1n suhosin: false imagick_availability: true pretty_permalinks: true ### wp-database ### extension: mysqli server_version: 10.11.3-MariaDB-1:10.11.3+maria~ubu2204 client_version: mysqlnd 8.0.29 max_allowed_packet: 16777216 max_connections: 151 ### wp-constants ### WP_HOME: http://localhost:8889/ WP_SITEURL: http://localhost:8889/ WP_CONTENT_DIR: /var/www/html/wp-content WP_PLUGIN_DIR: /var/www/html/wp-content/plugins WP_MEMORY_LIMIT: 40M WP_MAX_MEMORY_LIMIT: 256M WP_DEBUG: false WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: false WP_CACHE: false CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_ENVIRONMENT_TYPE: local DB_CHARSET: utf8 DB_COLLATE: undefined ### wp-filesystem ### wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable

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

glendaviesnz commented 1 year ago

I was able to replicate this. It cause by some images that are embedded in the patterns throwing CORs errors, eg. the background image in this pattern:

Screenshot 2023-06-12 at 5 24 59 PM

The FastAverageColor is trying to retrieve the image in the background and failing. We can't guarantee that every image used in a pattern will be setting CORs correctly so we should add some exception handling to deal gracefully with this.

glendaviesnz commented 1 year ago

I wasn't able to replicate this now on trunk. I think this issue may have been fixed by recent changes to the way that the cover block handles image processing. Going to close, but feel free to reopen if you still get these errors on 6.4 or GB 17+