gatsbyjs/gatsby · error
The asset with id: ${id}, contains no file.
Error message
The asset with id: ${id}, contains no file. What it means
Contentful asset download warning: the ContentfulAsset node has no `file` field — typically an asset that is unpublished, still processing, or whose upload failed in Contentful — so nothing is downloaded and the asset is skipped.
Source
Thrown at packages/gatsby-source-contentful/src/download-contentful-assets.js:58
} = gatsbyFunctions
// Any ContentfulAsset nodes will be downloaded, cached and copied to public/static
// regardless of if you use `localFile` to link an asset or not.
const bar = reporter.createProgress(
`Downloading Contentful Assets`,
assetNodes.length
)
bar.start()
await distributeWorkload(
assetNodes.map(node => async () => {
let fileNodeID
const { contentful_id: id, node_locale: locale } = node
const remoteDataCacheKey = `contentful-asset-${id}-${locale}`
const cacheRemoteData = await cache.get(remoteDataCacheKey)
if (!node.file) {
reporter.log(id, locale)
reporter.warn(`The asset with id: ${id}, contains no file.`)
return Promise.resolve()
}
if (!node.file.url) {
reporter.warn(
`The asset with id: ${id} has a file but the file contains no url.`
)
return Promise.resolve()
}
const url = createUrl(node.file.url)
// Avoid downloading the asset again if it's been cached
// Note: Contentful Assets do not provide useful metadata
// to compare a modified asset to a cached version?
if (cacheRemoteData) {
fileNodeID = cacheRemoteData.fileNodeID // eslint-disable-line prefer-destructuring
touchNode(getNode(cacheRemoteData.fileNodeID))
}
View on GitHub (pinned to e85d62f177)
Solutions
- Check the asset in Contentful and ensure it has an uploaded file
- Re-publish the asset and re-run the sync
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/gatsby-source-contentful/src/download-contentful-assets.js:58 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26).
Data as JSON: /api/errors/0fa7d62dde92657f.
Report an issue: GitHub.