Dont really understand why I Keep getting the error below when fileName existed.
Sometimes, the result returns more than 1 but it got stuck after another try.
PS D:\PROJECTS\test> node .\index.js 3
[]
created 91390203887582
red big_sr.png
D:\PROJECTS\test\index.js:54
${_layer.location}${_layer.selectedElement.fileName}
^
TypeError: Cannot read properties of undefined (reading 'fileName')
at D:\PROJECTS\test\index.js:54:57
at new Promise ()
at loadLayerImg (D:\PROJECTS\test\index.js:51:12)
at D:\PROJECTS\test\index.js:117:37
at Array.forEach ()
at startCreating (D:\PROJECTS\test\index.js:116:21)
at Object. (D:\PROJECTS\test\index.js:140:1)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
I am following the hashlip youtube video - Code generate art Update Part 1. https://www.youtube.com/watch?v=Ksb3JIomuqM&list=PLvfQp12V0hS3AVImYdMNfkdvRtZEe7xqY&index=5
Dont really understand why I Keep getting the error below when fileName existed. Sometimes, the result returns more than 1 but it got stuck after another try.
PS D:\PROJECTS\test> node .\index.js 3 [] created 91390203887582 red big_sr.png D:\PROJECTS\test\index.js:54)
at loadLayerImg (D:\PROJECTS\test\index.js:51:12)
at D:\PROJECTS\test\index.js:117:37
at Array.forEach ()
at startCreating (D:\PROJECTS\test\index.js:116:21)
at Object. (D:\PROJECTS\test\index.js:140:1)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
${_layer.location}${_layer.selectedElement.fileName}
^ TypeError: Cannot read properties of undefined (reading 'fileName') at D:\PROJECTS\test\index.js:54:57 at new Promise (Here are my codes:
is it something wrong with the while loop and layer images??
images of my layers![image](https://user-images.githubusercontent.com/14257638/159510476-81919a97-85b1-4f8c-98fd-6d64cefcfbd7.png)
would appreciate some explanation if possible.