Skip to content

onSuccess callback not working on Windows #477

@capsloq

Description

@capsloq

I know Windows is not fully supported however this node error may be prevented by using file:// on Windows

Reproduce:

  1. Use Windows System
  2. 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)
  },
})
  1. 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:'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions