invakid404 / payload-blurhash-plugin

Payload CMS plugin for automatic Blurhash encoding of images
The Unlicense
57 stars 5 forks source link

Crash after uploading image #1

Closed matthijs166 closed 2 years ago

matthijs166 commented 2 years ago

When I upload a new image I get the error;

TypeError: Cannot read properties of undefined (reading 'config')
    at getMediaDirectory (C:\Users\*\Documents\*\backend\node_modules\payload-blurhash-plugin\src\index.ts:11:32)
    at C:\Users\*\Documents\*\backend\node_modules\payload-blurhash-plugin\src\index.ts:64:24
    at step (C:\Users\*\Documents\*\backend\node_modules\payload-blurhash-plugin\lib\index.js:67:23)
    at Object.next (C:\Users\*\Documents\*\backend\node_modules\payload-blurhash-plugin\lib\index.js:48:53)
    at C:\Users\*\Documents\*\backend\node_modules\payload-blurhash-plugin\lib\index.js:42:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\*\Documents\*\backend\node_modules\payload-blurhash-plugin\lib\index.js:38:12)
    at hook (C:\Users\*\Documents\*\backend\node_modules\payload-blurhash-plugin\lib\index.js:102:20)
    at C:\Users\*\Documents\*\backend\node_modules\payload\src\collections\operations\update.ts:176:19
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
"payload": "^1.0.11",
invakid404 commented 2 years ago

@matthijs166 thanks a lot for the PR, I've merged it and confirmed the plugin works as expected with Payload 1.0.11 now. I'll release a new version shortly :^)

matthijs166 commented 2 years ago

@invakid404 Awesome your a hero!