#62146 closed defect (bug) (fixed)
WordPress 6.7.0 beta1 is failing to load scripts.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | 6.7 |
Component: | Script Loader | Keywords: | has-patch |
Focuses: | javascript | Cc: |
Description
I have WordPress 6.7.0 beta1 installed at http://localhost/wp/.
The root is also http://localhost/wp/.
The script fails to load here.
Failed loading URL
'http://localhost/wp-includes/js/dist/script-modules/block-library/navigation/view.min.js?ver=8ff192874fc8910a284c'
'http://localhost/wp-includes/js/dist/script-modules/interactivity/index.min.js?ver=2d6d1fdbcb3fda39c768'
This is http://localhost/... Instead, it should be http://localhost/wp/.. It should be.
Attachments (1)
Change History (11)
#1
@
7 months ago
- Component changed from General to Interactivity API
- Milestone changed from Awaiting Review to 6.7
#2
@
7 months ago
- Component changed from Interactivity API to General
- Milestone changed from 6.7 to Awaiting Review
- Owner set to jonsurrell
- Status changed from new to assigned
This ticket was mentioned in PR #7471 on WordPress/wordpress-develop by @jonsurrell.
7 months ago
#4
- Keywords has-patch added
[59083] introduced an issue where Script Modules registered src does not correctly respect the includes path.
Before that change, script modules were registered using includes_url
. The patch used a hard-coded path which breaks when sites are not served from the root, e.g. the site root is https://example.com/wp
instead of https://example.com/
.
Follow-up to [59083]
Fixes #62146
Trac ticket: https://core.trac.wordpress.org/ticket/62146
@jonsurrell commented on PR #7471:
7 months ago
#5
Previously Script Modules were registered with includes_url
:
The change _appeared_ to match how scripts are registered:
But that was incorrect, it's handled when printing scripts:
#6
@
7 months ago
- Component changed from General to Script Loader
- Severity changed from critical to normal
#7
@
7 months ago
Test Report
PR tested: https://github.com/WordPress/wordpress-develop/pull/7471
Environment
- OS: macOS Sonoma 14.3.1
- WordPress Version: Trunk branch
- Browser: Mozilla Firefox 130.0.1
Actual Results
After checking out the PR and building, the previously encountered script loading error no longer occurs.
Additional Notes
- The error was replicable when the WordPress site’s URL differed from the installation directory, i.e., WordPress was located at
wptrunk.local/build
instead of the top-level domainwptrunk.local
. - This behavior was consistent with what the original reporter observed.
- above is an image showing the error before checking out the PR
@cbravobernal commented on PR #7471:
7 months ago
#9
Committed with https://core.trac.wordpress.org/changeset/59154.
Thanks for the report, I'll prepare a patch.