Opened 6 weeks ago
Closed 5 weeks ago
#64656 closed defect (bug) (fixed)
Fatal error on new font library admin page
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | has-patch |
| Focuses: | Cc: |
Description
I'm currently seeing a fatal error when navigating to wp-admin/font-library.php in my site:
Uncaught Error: Failed opening required '/home1/USER/public_html/wp-includes/build/pages/font-library/../../constants.php' (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear')
in /home1/USER/public_html/wp-includes/build/pages/font-library/page-wp-admin.php on line 145
Call stack:
wp_font_library_wp_admin_enqueue_scripts('font-library.php')
wp-includes/class-wp-hook.php:341
WP_Hook::apply_filters(NULL, array)
wp-includes/class-wp-hook.php:365
WP_Hook::do_action(array)
wp-includes/plugin.php:522
do_action('admin_enqueue_scripts', 'font-library.php')
wp-admin/admin-header.php:123
require_once('/home1/USER/publ...min/admin-header.php')
wp-admin/font-library.php:33
Seems like it could possibly be related to #64393.
I am using the latest nightly build (7.0-alpha-61654) with WP_DEBUG set to true.
Change History (11)
This ticket was mentioned in PR #10965 on WordPress/wordpress-develop by @youknowriad.
5 weeks ago
#3
- Keywords has-patch added
## Summary
- Add
constants.phpto the list of PHP infrastructure files copied from Gutenberg's build output to Core incopy-gutenberg-build.js - Fix the
--base-urlargument inbuild-gutenberg.jsto include the trailing slash insideincludes_url('build/')instead of outside the function call
Without these fixes, the Font Library admin page throws a fatal error because:
constants.phpis never synced tosrc/wp-includes/build/- The
build_urlconstant is missing a trailing slash, generating URLs likewp-includes/buildpages/...instead ofwp-includes/build/pages/...
## Test plan
- Run
npm run gutenberg:copy -- --devand verifysrc/wp-includes/build/constants.phpexists - Visit the Font Library admin page and confirm it loads without errors
🤖 Generated with Claude Code
#5
@
5 weeks ago
It might be a good idea to add a simple e2e test in the core repo to check access for auto-generated pages. We would catch similar bugs early.
#6
@
5 weeks ago
- Keywords needs-patch added; has-patch removed
- Resolution fixed deleted
- Status changed from closed to reopened
Thanks for [61673] @youknowriad!
I've gone and rebuilt the nightly with the latest in trunk and updated my site. The page loads now, but it's just a blank, black screen.
Here is my full console output.
JQMIGRATE: Migrate is installed, version 3.4.1 load-scripts.php:5:981 Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. node.js:418:1 InstallTrigger is deprecated and will be removed in the future. utils.min.js:1:41665 Import maps are not allowed after a module load or preload has started. font-library.php GET https://jonathandesrosiers.com/wp-includes/buildpages/font-library/loader.js?ver=7.0-alpha-61675 NS_ERROR_CORRUPTED_CONTENT GET https://jonathandesrosiers.com/wp-includes/buildroutes/font-list/route.min.js?ver=5bf837c01b0b1bb1bc6f NS_ERROR_CORRUPTED_CONTENT GET https://jonathandesrosiers.com/wp-includes/buildroutes/fonts-home/route.min.js?ver=63fba8ad1ac5f2b9aba8 NS_ERROR_CORRUPTED_CONTENT Loading failed for the module with source “https://jonathandesrosiers.com/wp-includes/buildpages/font-library/loader.js?ver=7.0-alpha-61675”. font-library.php:730:163 Loading module from “https://jonathandesrosiers.com/wp-includes/buildpages/font-library/loader.js?ver=7.0-alpha-61675” was blocked because of a disallowed MIME type (“text/html”). font-library.php Loading module from “https://jonathandesrosiers.com/wp-includes/buildroutes/font-list/route.min.js?ver=5bf837c01b0b1bb1bc6f” was blocked because of a disallowed MIME type (“text/html”). font-library.php Loading module from “https://jonathandesrosiers.com/wp-includes/buildroutes/fonts-home/route.min.js?ver=63fba8ad1ac5f2b9aba8” was blocked because of a disallowed MIME type (“text/html”). font-library.php Uncaught (in promise) TypeError: The specifier “@wordpress/boot” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”. font-library.php downloadable font: Glyph bbox was incorrect (glyph ids 4) (font-family: "jetpack-protect" style:normal weight:400 stretch:100 src index:1) source: https://jonathandesrosiers.com/wp-content/plugins/jetpack-protect//assets/fonts/jetpack-protect.ttf?31wpn Partitioned cookie or storage access was provided to “https://widgets.wp.com/3rd-party-cookie-check/index.html” because it is loaded in the third-party context and dynamic state partitioning is enabled. autofill.js:1607:7 GET https://jonathandesrosiers.com/favicon.ico [HTTP/2 404 124ms]
This ticket was mentioned in Slack in #core by desrosj. View the logs.
5 weeks ago
#8
@
5 weeks ago
It might be a good idea to add a simple e2e test in the core repo to check access for auto-generated pages. We would catch similar bugs early.
I'd love if we can run all gutenberg e2e tests on core personally.
This ticket was mentioned in PR #10974 on WordPress/wordpress-develop by @youknowriad.
5 weeks ago
#9
- Keywords has-patch added; needs-patch removed
Invoke node bin/build.mjs directly instead of going through npm run build --, which forwards arguments through a shell layer that can mangle the --base-url value (containing spaces, parentheses, and single quotes) on some platforms. This caused the generated constants.php to be missing the trailing slash in the build_url on certain Linux machines.
## Use of AI Tools
This PR was co-authored with Claude Code (Claude Opus 4.6).
I just ran into this as well, similar, not quote the same:
GET https://example.org/wp-admin/themes.php?page=font-library-wp-admin Uncaught Error: Failed opening required 'wp-includes/build/constants.php' (include_path='.:') in wp-includes/build/routes.php on line 44 Call stack: wp_register_page_routes(array, 'wp_register_font_library_wp_admin_route') wp_register_font_library_wp_admin_page_routes('') WP_Hook::apply_filters('', array) WP_Hook::do_action(array) do_action('font-library-wp-admin_init') gutenberg_font_library_wp_admin_enqueue_scripts('appearance_page_font-library-wp-admin') WP_Hook::apply_filters(NULL, array) WP_Hook::do_action(array) do_action('admin_enqueue_scripts', 'appearance_page_font-library-wp-admin') require_once('wp-admin/admin-header.php') require_once('wp-admin/admin.php')