obsidian-github-publisher: [Bug]: TypeError: Cannot read properties of null (reading 'endsWith')

Issue validation

  • I checked the issue to prevent duplicate
  • I checked my configurations files and the documentation

Command used

Upload all notes, Upload unpublished notes, Upload single current active note Refresh published and upload new notes, Refresh all published notes

Plugin version

5.5.5

Describe the bug

error log with TypeError: Cannot read properties of null (reading ‘endsWith’)

If the Upload configuration > File tree in repository configuration is Obsidian path, Error not occurred. But when I published new note using YAML frontmatter configuration with Upload single current active note command, Making new branch and Uploading file to the repository are working But merging progress that new branch is merged to the main branch what I configured is not implemented.

image

Another issue is relavant. If refresh the notes (e.g. Refresh published and upload new notes Command), cannot execute the function with this error log

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'endsWith')

How to reproduce ?

Publish notes with YAML format

Minimal Reproducible Example

---
title: Hello
share: true
---
# Hello
asdf

→ I write the new note for the testing, but It is not working.

Configuration

{
  "github": {
    "branch": "main",
    "automaticallyMergePR": true,
    "api": {
      "tiersForApi": "Github Free/Pro/Team (default)"
    },
    "worflow": {
      "workflowName": "",
      "customCommitMsg": ""
    }
  },
  "upload": {
    "behavior": "yaml",
    "defaultName": "docs",
    "rootFolder": "docs",
    "yamlFolderKey": "category",
    "frontmatterTitle": {
      "enable": false,
      "key": "title"
    },
    "replaceTitle": [],
    "replacePath": [],
    "autoclean": {
      "enable": true,
      "excluded": [
        "docs/assets/js",
        "docs/assets/meta",
        "docs/assets/css",
        "docs/tags.md",
        "docs/assets/img"
      ]
    },
    "folderNote": {
      "enable": false,
      "rename": "index.md"
    },
    "metadataExtractorPath": ""
  },
  "conversion": {
    "hardbreak": true,
    "dataview": true,
    "censorText": [],
    "tags": {
      "inline": true,
      "exclude": [],
      "fields": []
    },
    "links": {
      "internal": true,
      "unshared": true,
      "wiki": true
    }
  },
  "embed": {
    "attachments": true,
    "keySendFile": [],
    "notes": true,
    "folder": "docs/attachments"
  },
  "plugin": {
    "shareKey": "share",
    "fileMenu": true,
    "editorMenu": false,
    "excludedFolder": [],
    "copyLink": {
      "enable": false
      "removePart": [
        ""
      ],
      "addCmd": false
    },
    "noticeError": false
  }
}

Relevant log output

TypeError: Cannot read properties of null (reading 'endsWith')
    at Rl (plugin:obsidian-mkdocs-publisher:53:2714)
    at Al (plugin:obsidian-mkdocs-publisher:53:2936)
    at Ue (plugin:obsidian-mkdocs-publisher:53:4302)
    at sr.getAllFileWithPath (plugin:obsidian-mkdocs-publisher:57:7157)
    at eval (plugin:obsidian-mkdocs-publisher:54:35745)
    at Generator.next (<anonymous>)
    at s (plugin:obsidian-mkdocs-publisher:6:691)

image

  • Refresh published and upload new notes Command error:

image

OS

MacOS

Anything else?

  1. I’ve got into this problem when I updated obsidian github publisher plugin to version 5
  2. For this issue, I’ve tried to using the this repository to using the latest version of template configuration that you recommended. → https://github.com/ObsidianPublisher/follow_template

Obsidian information

SYSTEM INFO:
	Obsidian version: v1.1.16
	Installer version: v0.14.6
	Operating system: Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:35 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T8103 22.3.0
	Login status: logged in
	Catalyst license: none
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: light
	Community theme: Minimal
	Snippets enabled: 3
	Restricted mode: off
	Plugins installed: 25
	Plugins enabled: 25
		1: Obsidian Git v2.16.0
		2: Kanban v1.5.1
		3: Tweet to Markdown v2.12.1
		4: Advanced Tables v0.18.1
		5: Tag Wrangler v0.5.6
		6: Outliner v4.2.1
		7: Readwise Official v2.0.1
		8: Editor Syntax Highlight v0.1.3
		9: Emoji Shortcodes v2.2.0
		10: Copy as HTML v1.0.6
		11: Image Caption v0.0.13
		12: Find orphaned files and broken links v1.8.0
		13: Auto Link Title v1.4.1
		14: cMenu v1.1.2
		15: Dataview v0.5.54
		16: Templater v1.16.0
		17: Note Refactor v1.7.1
		18: Calendar v1.5.10
		19: Hotkeys for templates v1.4.3
		20: Checklist v2.2.12
		21: Simple Embeds v1.14.1
		22: Regex Find/Replace v1.2.0
		23: Linter v1.10.1
		24: Metacopy v1.9.1
		25: Github Publisher v5.5.5

RECOMMENDATIONS:
	Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

It’s perfect! Thanks ✨

I really don’t know why it does that, so I live the issue open in case someone have the same problem!