codeSTACKr / create-10k-nft-collection

MIT License
2.21k stars 717 forks source link

TypeError: Cannot read properties of undefined (reading 'path')[Bug]: #173

Open samnicholss opened 2 years ago

samnicholss commented 2 years ago

Version

General Question

What happened?

Hey there, i will run the code to generate my images, and everytime a certain amount will work but then I will suddenly get this error half way through. I have tried everything including ensuring my layer names are the same, rearranging layer order etc, however it keeps coming up with this error.

TypeError: Cannot read properties of undefined (reading 'path') at /Users/samnichols/Desktop/create-10k-nft-collection-main/src/main.js:184:61 at new Promise () at loadLayerImg (/Users/samnichols/Desktop/create-10k-nft-collection-main/src/main.js:183:10) at /Users/samnichols/Desktop/create-10k-nft-collection-main/src/main.js:364:31 at Array.forEach () at startCreating (/Users/samnichols/Desktop/create-10k-nft-collection-main/src/main.js:363:17) at processTicksAndRejections (node:internal/process/task_queues:96:5) Please help ASAP!

What have you tried?

I have tried everything including ensuring my layer names are the same, rearranging layer order etc, however it keeps coming up with this error.

Relevant log output

TypeError: Cannot read properties of undefined (reading 'path')
    at /Users/samnichols/Desktop/create-10k-nft-collection-main/src/main.js:184:61
    at new Promise (<anonymous>)
    at loadLayerImg (/Users/samnichols/Desktop/create-10k-nft-collection-main/src/main.js:183:10)
    at /Users/samnichols/Desktop/create-10k-nft-collection-main/src/main.js:364:31
    at Array.forEach (<anonymous>)
    at startCreating (/Users/samnichols/Desktop/create-10k-nft-collection-main/src/main.js:363:17)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Protect your information

wolfGT commented 2 years ago

From the README:

Any sort of "path" error Ensure that your layer names in the config.js file match exactly to your layer folder names. Also, remove any - (hyphens) from your file names.

samnicholss commented 2 years ago

All the layer names match the config file and layer folder names, furthermore there are no hyphens in any of the file names.

I am now getting a new error;

(node:37112) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead (Use node --trace-deprecation ... to show where the warning was created)

wolfGT commented 2 years ago

All the layer names match the config file and layer folder names, furthermore there are no hyphens in any of the file names.

I am now getting a new error;

(node:37112) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead (Use node --trace-deprecation ... to show where the warning was created)

That is not an error. It is a warning, it probably can just be ignored :-)

Noccoo commented 2 years ago

node --trace-deprecation

Hello Having rouble with this - (node:7808) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'path' of undefined

const loadLayerImg = async (_layer) => { return new Promise(async (resolve) => { const image = await loadImage(${_layer.selectedElement.path}); resolve({ layer: _layer, loadedImage: image }); }); };

Would be awesome if you could help me :)

Bobata-constantlyafk commented 2 years ago

FIXED! AUG 2022. Go to the "codeSTACKr/create-10k-nft-collection" git repository. Then go to /utils/nftport/uploadFiles.js. After that next to the change branch option you can find change the tag. Change it to v1.2.0 - he updated the code and if you change to 1.2.0 you will find the version that worked for me. Godspeed.