Reputation: 491
I am working on packing my course notes together using bookdown. When I try to view my chapter updates using bookdown:::serve_book()
or simply knitting the document (supposedly a shortcut to preview_chapter
) I get the error message below. And only after updating.
Error in basename(with_ext(nms, ".html")) : path too long
Calls: <Anonymous> ... <Anonymous> -> <Anonymous> -> split_chapters -> basename
Please delete MATH456_notes.md after you finish debugging the error.
Execution halted
If I remove the mentioned .md
file, AND clean the whole project using rmarkdown::clean_site()
, it will compile just fine. But if I make changes, and try to view the update I get the following message.
Any ideas what is going on? I really don't want to rebuild the entire book every time I want to preview the current chapter.
If i'm previewing the book, and make any small change, the auto-update/live preview also throws the same error.
Upvotes: 4
Views: 217
Reputation: 93
I know this thread is old, but maybe my answer may help others in the future. :) So for all of you who still encounter this error:
For me, the problem can be fixed by checking all headings. Most likely you inserted a hashtag # in the wrong place (i.e. in the body text) without closing it, so Bookdown detects a new main chapter (i.e. level 1) that has an extremely long heading name.
I would recommend saving the index.rmd in a second backup file and then deleting each chapter individually, starting at the bottom. Once your book renders again with no problems, you will know which chapter is causing the problem. Watch out for problematic hashtags # and headings there.
Upvotes: 1