Getting an Uncaught (in promise) DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string error when uploading an asset and then trying to preview an entry.
Steps to reproduce
Click 'Upload Files' on an assets field
Upload an image
Click 'Preview'
Tested on a local filesystem, asset field settings are all set to the default. Dragging an image onto the field works without error.
Tested in Chrome, Safari and Firefox - the error differs slightly in each.
Live Preview window doesn't show, and this error is shown in the browser console:
jquery.js?v=1707205984:2 Uncaught (in promise) DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.
at HTMLInputElement.<anonymous> (https://craft5.ddev.site/cpresources/624f2193/jquery.js?v=1707205984:2:67445)
at Function.each (https://craft5.ddev.site/cpresources/624f2193/jquery.js?v=1707205984:2:3091)
at T.fn.init.each (https://craft5.ddev.site/cpresources/624f2193/jquery.js?v=1707205984:2:1571)
at T.fn.init.val (https://craft5.ddev.site/cpresources/624f2193/jquery.js?v=1707205984:2:67137)
at Object.copyInputValues (https://craft5.ddev.site/cpresources/1ab53bc8/garnish.js?v=1711503619:2:112805)
at s.constructor._getClone (https://craft5.ddev.site/cpresources/ef40e11e/cp.js?v=1713140127:2:632336)
at s.constructor.open (https://craft5.ddev.site/cpresources/ef40e11e/cp.js?v=1713140127:2:622757)
at s.constructor.<anonymous> (https://craft5.ddev.site/cpresources/ef40e11e/cp.js?v=1713140127:2:451105)
at f (https://craft5.ddev.site/cpresources/ef40e11e/cp.js?v=1713140127:2:425357)
at Generator.<anonymous> (https://craft5.ddev.site/cpresources/ef40e11e/cp.js?v=1713140127:2:426703)
What happened?
Description
Getting an
Uncaught (in promise) DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string
error when uploading an asset and then trying to preview an entry.Steps to reproduce
Tested on a local filesystem, asset field settings are all set to the default. Dragging an image onto the field works without error.
Tested in Chrome, Safari and Firefox - the error differs slightly in each.
https://github.com/craftcms/cms/assets/867566/3a46f9b2-8de2-4924-9060-7015de3fa974
Expected behavior
Live Preview loads correctly
Actual behavior
Live Preview window doesn't show, and this error is shown in the browser console:
Craft CMS version
Tested on 4.8.9 & 5.0.4
PHP version
8.2
Operating system and version
No response
Database type and version
MySQL 8.0
Image driver and version
No response
Installed plugins and versions
-