Social Media Image Kit

Social Media Image Kit

Troubleshooting

The following information may help troubleshooting common issues when working with Social Media Image Kit.

#Front-end: Cannot Convert String to Array

If you are receiving an error stating something similar to "Cannot convert string to array" when rendering your front-end pages after generating images, the most common cause is forgetting to add the required fieldset to your blueprints.

If the blueprint contains the fieldset, ensure that it has not been prefixed. Additionally, if you've changed the asset field name, ensure that the asset field name in the fieldset has been updated.

#"Unable to find asset with ID:" Exceptions or Log Messages

If you are receiving front-end exceptions with a message similar to "Unable to find asset with ID", or are seeing these messages in your logs a collection blueprint was not configured with the required Social Media Image Kit fieldset.

If the blueprint contains the fieldset, ensure that it has not been prefixed. Additionally, if you've changed the asset field name, ensure that the asset field name in the fieldset has been updated.

#Node.js Errors When Generating Images

If you are seeing exceptions when generating images, and see messages similar to the following in your logs:

1node:events:495
2 throw er; // Unhandled 'error' event
3 ^
4
5Error: read ENOTCONN
6 at tryReadStart (node:net:710:20)
7 at Socket._read (node:net:725:5)
8 at Readable.read (node:internal/streams/readable:507:12)
9 at Socket.read (node:net:781:39)
10 at new Socket (node:net:498:12)
11 at Object.Socket (node:net:367:41)
12 at createSocket (node:internal/child_process:329:14)
13 at ChildProcess.spawn (node:internal/child_process:444:23)
14 at Object.spawn (node:child_process:761:9)
15 at new Process (node_modules\@puppeteer\browsers\lib\cjs\launch.js:107:56)
16Emitted 'error' event on Interface instance at:
17 at Socket.onerror (node:internal/readline/interface:246:10)
18 at Socket.emit (node:events:517:28)
19 at emitErrorNT (node:internal/streams/destroy:151:8)
20 at emitErrorCloseNT (node:internal/streams/destroy:116:3)
21 at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
22 errno: -4053,
23 code: 'ENOTCONN',
24 syscall: 'read'
25}

the most common causes are either a misconfigured environment or missing Puppeteer. The default HTML renderer utilizes the Browsershot package. For more help on configuring Browsershot, as well as its requirements, please refer to the following articles:

If you are receiving these errors when making changes in the Control Panel, but not when running the Artisan command, ensure that node and Puppeteer are available within your system's PATH environment variable. If you only intend on generating images with the command line, you may disable Social Media Image Kit's event listeners by setting the events_enabled value to false within the config/social_media_image_kit/queue.php configuration file.

#Asset Container Does not Exist

If you've modified the asset container field name in the configuration file and are receiving errors stating the container does not exist, ensure that the asset container within the Social Media Image Kit fieldset has also been updated.

Some absolutely amazing
people

The following amazing people help support this site and my open source projects ♥️
If you're interesting in supporting my work and want to show up on this list, check out my GitHub Sponsors Profile.