#62146 closed defect (bug) (fixed)
WordPress 6.7.0 beta1 is failing to load scripts.
| Reported by: | nendeb55 | Owned by: | jonsurrell |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.7 |
| Component: | Script Loader | Version: | 6.7 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | javascript |
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)
#2
@
22 months ago
- Component Interactivity API → General
- Milestone 6.7 → Awaiting Review
- Owner set to
- Status new → assigned
This ticket was mentioned in PR #7471 on WordPress/wordpress-develop by @jonsurrell.
22 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:
22 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:
#7
@
22 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/buildinstead 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:
22 months ago
#9
Committed with https://core.trac.wordpress.org/changeset/59154.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thanks for the report, I'll prepare a patch.