#unhandledRejection TypeError: Cannot read properties of undefined (reading 'mime')
4 messages · Page 1 of 1 (latest)
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
Here is my media collection
export const Media: CollectionConfig = {
slug: 'media',
upload: {
staticDir: path.resolve(__dirname, '../../media'),
mimeTypes: ['image/png','image/svg'],
},
access: {
read: () => true,
},
fields: [
{
name: 'alt',
type: 'text',
required: true,
},
]
}
Here is the code when I trying to seed the svg
await payload.create({
collection: 'media',
filePath: path.resolve(__dirname, './media/lang-icon-t.svg'),
data: {
alt: 'TranslateIcon',
mimeType: 'image/svg',
},
}),