You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I am having trouble diagnosing a bug in my code. Whenever I add a new size to TARGETS, the first time I run this script I get
rocess].Useemitter.setMaxListeners()toincreaselimit
node:child_process:326ex=newError('Command failed: '+cmd+'\n'+stderr);^
Error: Command failed: /bin/cp/tmp/my_images/457.pngpublic/img/icons//android-chrome-457x457.png
cp: /tmp/my_images/457.png: NosuchfileordirectoryatChildProcess.exithandler(node:child_process:326:12)atChildProcess.emit(node:events:369:20)atmaybeClose(node:internal/child_process:1067:16)atSocket.<anonymous>(node:internal/child_process:453:11)atSocket.emit(node:events:369:20)atPipe.<anonymous>(node:net:665:12){killed: false,code: 1,signal: null,cmd: '/bin/cp /tmp/my_images/457.png public/img/icons//android-chrome-457x457.png',stdout: '',stderr: 'cp: /tmp/my_images/457.png: No such file or directory\n'}
But normally after running my script a second time it works without a hitch. I suspect the bug comes from svgexport.render resolving BEFORE the files have been moved to their output locations. Then moveFiles runs before the file exists, and thus the error. This would also explain why often times running it a second time works.
My question: Is this a bug in this library, or is there something I can do to my code to fix it?
Thanks
The text was updated successfully, but these errors were encountered:
edit: nvm, 👇 error is just because svgexport adds event listeners for SIGINT, SIGTERM, and SIGHUP for each render job.
btw while I'm here, I also have another (probably unrelated) question. Even when the script is successful, my output looks like this
❯ ./tools/createIcons.mjs src/assets/My-Logo.svg public/img/icons/
(node:2404) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:2404) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:2404) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:2404) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
I am trying to make a script to auto-generate icon files and send them to the right spots. This is what I have so far
However, I am having trouble diagnosing a bug in my code. Whenever I add a new size to
TARGETS
, the first time I run this script I getBut normally after running my script a second time it works without a hitch. I suspect the bug comes from
svgexport.render
resolving BEFORE the files have been moved to their output locations. ThenmoveFiles
runs before the file exists, and thus the error. This would also explain why often times running it a second time works.My question: Is this a bug in this library, or is there something I can do to my code to fix it?
Thanks
The text was updated successfully, but these errors were encountered: