content icon indicating copy to clipboard operation
content copied to clipboard

Stray files in content directory, cause build to fail

Open oripka opened this issue 3 months ago • 1 comments

I had a stray png in the content dir and it caused by production build to fail, dev was fine.

I suggest changing this line(, to check if item is defined)

const dirConfig = db.find((item: any) => item._path === joinURL(path, '_dir'))

to

const dirConfig = db.find((item: any) => item?._path === joinURL(path, '_dir'))

https://github.com/nuxt/content/blob/f753723d3cd4d8f8a92d050b9be59489c522c35f/src/runtime/query/match/pipeline.ts#L79

oripka avatar Apr 10 '24 21:04 oripka