Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when Blogger draft has no title: throw er; // Unhandled 'error' event #38

Open
levid0s opened this issue Mar 4, 2023 · 0 comments

Comments

@levid0s
Copy link

levid0s commented Mar 4, 2023

When I ran blog2md on my Blogger export, it crashed with the following error:

PS D:\temp\blog2md> ..\node-v18.14.2-win-x64\node.exe index.js b .\blog-03-04-2023.xml ./myblog
INFO: Comments requested to be a separate .md file(m - default)
Total no. of entries found : 295
Content-posts 63
Content-Comments 180
title: "undefined"
date: 2014-08-08T01:35:00.001+03:00
draft: true
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: Input must be string
    at sanitize (D:\temp\blog2md\node_modules\sanitize-filename\index.js:41:11)
    at module.exports (D:\temp\blog2md\node_modules\sanitize-filename\index.js:54:16)
    at getFileName (D:\temp\blog2md\index.js:245:23)
    at D:\temp\blog2md\index.js:306:42
    at Array.forEach (<anonymous>)
    at D:\temp\blog2md\index.js:286:23
    at Parser.<anonymous> (D:\temp\blog2md\node_modules\xml2js\lib\parser.js:303:18)
    at Parser.emit (node:events:513:28)
    at SAXParser.onclosetag (D:\temp\blog2md\node_modules\xml2js\lib\parser.js:261:26)
    at emit (D:\temp\blog2md\node_modules\sax\lib\sax.js:624:35)
Emitted 'error' event on Parser instance at:
    at exports.Parser.Parser.parseString (D:\temp\blog2md\node_modules\xml2js\lib\parser.js:326:16)
    at Parser.parseString (D:\temp\blog2md\node_modules\xml2js\lib\parser.js:5:59)
    at D:\temp\blog2md\index.js:257:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)

I realised this was caused by an unpublished draft from 2014 that didn't have a title configured.
After adding a title on Blogger, and downloading a new .xml export, blog2md worked sucessfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant