Skip to content

Fix asset file fetch error in Directus extension#131

Merged
denbec merged 1 commit intomainfrom
denbec/fix-asset-file-fetch
Feb 6, 2026
Merged

Fix asset file fetch error in Directus extension#131
denbec merged 1 commit intomainfrom
denbec/fix-asset-file-fetch

Conversation

@denbec
Copy link
Collaborator

@denbec denbec commented Feb 6, 2026

Summary

Fixed the "Cannot read properties of undefined (reading 'transforms')" error that occurred when fetching files during asset generation.

The issue was in the getFileAsBase64() function which was calling assetsService.getAsset(fileId, {}) with an empty transformation object. This caused Directus' internal resolvePreset() to attempt destructuring transformationParams as undefined, leading to the error.

Since no image transformations are needed for base64 conversion, the transformation parameter is now omitted.

Test plan

  • Regenerate assets for podcasts in the live Directus environment
  • Verify no "Cannot read properties of undefined" errors occur
  • Confirm generated assets are created successfully

🤖 Generated with Claude Code

The AssetsService.getAsset() method was being called with an empty object {} as the transformation parameter. This caused resolvePreset to attempt destructuring transformationParams as undefined, resulting in "Cannot read properties of undefined (reading 'transforms')". Since no transformations are needed for the base64 conversion, the parameter is now omitted.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
programmierbar-website Building Building Preview, Comment Feb 6, 2026 5:01pm

Request Review

@denbec denbec merged commit e63fb9b into main Feb 6, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant