rooofl Posted Friday at 08:03 AM Posted Friday at 08:03 AM Hello, I am facing an upload issue. I get this JS error when I drop images in image fields: XHR POSThttps://foo.com/admin/page/edit/?id=1102&InputfieldFileAjax=1[HTTP/2 403 41ms] Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data uploadFile https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 uploadFile https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 traverseFiles https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 setupDropzone https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 setupDropzone https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 initHTML5Item https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 initUploadHTML5 https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 jQuery 2 initUploadHTML5 https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 init https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 InputfieldImage https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 <anonymous> https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 jQuery 8 InputfieldImage.min.js:1:35804 I updated PW recently and also upgraded the PHP version. Maybe that can be related!
matjazp Posted Friday at 10:23 AM Posted Friday at 10:23 AM Check PW error logs. This is because of the error in php/module resulting in invalid JSON. Do a modules refresh and upgrade them to the latest version.
rooofl Posted Friday at 11:18 AM Author Posted Friday at 11:18 AM Thank you @matjazp. I refreshed the modules from the log. I think I updated all the module that needed to be updated (I guess). I also installed the Upgrades module to be sure. The logs doesn’t log anything when I try to upload an image. The error remains. My FieldtypeFile module is at v. 1.0.7 and FieldtypeImage at v. 1.0.2.
matjazp Posted Friday at 11:31 AM Posted Friday at 11:31 AM You have PHP 8.4? Then use the latest (not yet dev): https://github.com/processwire/processwire/archive/dbbb239a74231d5371c77cd23cb6e48aba90b8ef.zip
rooofl Posted Friday at 11:51 AM Author Posted Friday at 11:51 AM Yes I have PHP 8.4. I tried to install the PW version you advise, but my site and admin went totally blank, even with debug enabled in config.
matjazp Posted Friday at 11:53 AM Posted Friday at 11:53 AM Do you have access to admin? To the file system? Double check that you uploaded the complete wire directory and new indxex.php file.
rooofl Posted yesterday at 07:01 AM Author Posted yesterday at 07:01 AM Yes, I triple checked everything. Also, I wonder why it would not work with the current PW version I use: 3.0.246
matjazp Posted yesterday at 06:24 PM Posted yesterday at 06:24 PM 11 hours ago, rooofl said: Also, I wonder why it would not work with the current PW version I use: 3.0.246 Because 3.0.246 might not be 100% compatible with PHP 8.4. On 10/10/2025 at 1:51 PM, rooofl said: I tried to install the PW version you advise, but my site and admin went totally blank, even with debug enabled in config. That's odd. I use this version even on PHP 8.5 without (major) issues.
rooofl Posted 7 hours ago Author Posted 7 hours ago 12 hours ago, matjazp said: Because 3.0.246 might not be 100% compatible with PHP 8.4. But the issue existed with the older version of PHP I ran, actually I upgrade PHP and PW because of this issue.
matjazp Posted 4 hours ago Posted 4 hours ago 3 hours ago, rooofl said: But the issue existed with the older version of PHP I ran, actually I upgrade PHP and PW because of this issue. This is new information. You stated in the first post that your upgraded PHP and PW. Check XHR response headers in browser's dev tools.
monollonom Posted 2 hours ago Posted 2 hours ago There are quite a few topics with this issue but maybe this specific answer from @Robin S could help? Also, since it seems to be an issue with AJAX, are you seeing any difference if you toggle on (or off) this option?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now