Opened 5 years ago
Closed 4 years ago
#49292 closed defect (bug) (worksforme)
Fix javascript error caused by incorrectly escaped url
Reported by: | juliastri | Owned by: | juliastri |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.3.2 |
Component: | Script Loader | Keywords: | reporter-feedback close |
Focuses: | javascript | Cc: |
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
@
5 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
@
5 years ago
- Component changed from General to 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
@
5 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
@
4 years ago
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from assigned to 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.
The error message