Opened 7 years ago
Closed 6 years ago
#49292 closed defect (bug) (worksforme)
Fix javascript error caused by incorrectly escaped url
| Reported by: | juliastri | Owned by: | juliastri |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Script Loader | Version: | 5.3.2 |
| Severity: | normal | Keywords: | reporter-feedback close |
| Cc: | Focuses: | javascript |
Description
This error message appears in the console on all pages in wp-admin:
Uncaught SyntaxError: missing ) after argument list
It is caused by this line, as seen in the browser console:
<script> ( "fetch" in window ) || document.write( "<script src="http://wv5.local.com/wp-includes/js/dist/vendor/wp-polyfill-fetch.min.js?ver=3.0.0"></scr" + "ipt>" );( document.contains ) || document.write( "<script src="http://wv5.local.com/wp-includes/js/dist/vendor/wp-polyfill-node-contains.min.js?ver=3.26.0-0"></scr" + "ipt>" );( window.FormData && window.FormData.prototype.keys ) || document.write( "<script src="http://wv5.local.com/wp-includes/js/dist/vendor/wp-polyfill-formdata.min.js?ver=3.0.12"></scr" + "ipt>" );( Element.prototype.matches && Element.prototype.closest ) || document.write( "<script src="http://wv5.local.com/wp-includes/js/dist/vendor/wp-polyfill-element-closest.min.js?ver=2.0.2"></scr" + "ipt>" ); </script>
Attachments (3)
Change History (7)
#1
in reply to: ↑ description
@
7 years ago
Replying to juliastri:
This error message appears in the console on all pages in wp-admin:
Uncaught SyntaxError: missing ) after argument listIt is caused by this line, as seen in the browser console:
<script> ( "fetch" in window ) || document.write( "<script src="http://wv5.local.com/wp-includes/js/dist/vendor/wp-polyfill-fetch.min.js?ver=3.0.0"></scr" + "ipt>" );( document.contains ) || document.write( "<script src="http://wv5.local.com/wp-includes/js/dist/vendor/wp-polyfill-node-contains.min.js?ver=3.26.0-0"></scr" + "ipt>" );( window.FormData && window.FormData.prototype.keys ) || document.write( "<script src="http://wv5.local.com/wp-includes/js/dist/vendor/wp-polyfill-formdata.min.js?ver=3.0.12"></scr" + "ipt>" );( Element.prototype.matches && Element.prototype.closest ) || document.write( "<script src="http://wv5.local.com/wp-includes/js/dist/vendor/wp-polyfill-element-closest.min.js?ver=2.0.2"></scr" + "ipt>" ); </script>
Note:
I know how to fix it.
The problem is in wp-includes/script-loader.php file where the escaped string inside $polyfill is not rendered correctly.
#2
@
7 years ago
- Component General → Script Loader
- Keywords reporter-feedback added
Hello @juliastri, welcome to WordPress Trac!
Thanks for your report. Are you using a custom plugin or something else which modifies the HTML output? Because by default, as you can see in your patch, the string starts with a single quote mark (') and not a double quote mark (") which shouldn't cause this issue.
#3
@
7 years ago
- Keywords close added
I'm also unable to reproduce this.
@juliastri are you using version 5.3.2? trunk?
Going to add close pending more feedback.
#4
@
6 years ago
- Milestone Awaiting Review
- Resolution → worksforme
- Status assigned → closed
Hello @juliastri,
I'm closing this ticket as it's been a year since feedback was requested. However, if this problem persists today, please feel free to reopen and provide us with more information, i.e. to help us further investigate.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The error message