I know Windows is not fully supported however this node error may be prevented by using file:// on Windows
Reproduce:
- Use Windows System
- Use a onSuccess Callback
export default makeSource({
onExtraFieldData: 'ignore',
contentDirPath: 'mdx',
/* ^^^^^^^ Directory with the Markdown files. */
documentTypes: [Post, Rezept],
onSuccess: async (importData) => {
const {allDocuments} = await importData()
console.log('allDocuments', allDocuments.length)
},
})
- Error in Console
successCallback F:/Projekte/contentlayer-test/.contentlayer
SuccessCallbackError: Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file and data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'f:'
I know Windows is not fully supported however this node error may be prevented by using
file://on WindowsReproduce: