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

TypeError: Cannot read property 'domain' of undefined #4

Closed
congwang opened this issue Jan 31, 2015 · 3 comments
Closed

TypeError: Cannot read property 'domain' of undefined #4

congwang opened this issue Jan 31, 2015 · 3 comments

Comments

@congwang
Copy link

TypeError: Cannot read property 'domain' of undefined
at /home/wangcong/project/test/node_modules/hexo-migrator-wordpress/index.js:76:31
at Array.forEach (native)
at /home/wangcong/project/test/node_modules/hexo-migrator-wordpress/index.js:73:25
at /home/wangcong/project/test/node_modules/hexo-migrator-wordpress/node_modules/async/lib/async.js:118:13
at Array.forEach (native)
at _each (/home/wangcong/project/test/node_modules/hexo-migrator-wordpress/node_modules/async/lib/async.js:39:24)
at Object.async.each (/home/wangcong/project/test/node_modules/hexo-migrator-wordpress/node_modules/async/lib/async.js:117:9)
at /home/wangcong/project/test/node_modules/hexo-migrator-wordpress/index.js:49:13
at fn (/home/wangcong/project/test/node_modules/hexo-migrator-wordpress/node_modules/async/lib/async.js:626:34)
at Object._onImmediate (/home/wangcong/project/test/node_modules/hexo-migrator-wordpress/node_modules/async/lib/async.js:542:34)�[39m

@kfranqueiro
Copy link

I receive this error as well. I suspect it is because there is an initial category tag in each item that has no attributes whatsoever, whereas the migrator code immediately assumes the existence of category.$.domain (where $ is undefined).

Example:

        <category><![CDATA[JavaScript]]></category>
        <category domain="category" nicename="js"><![CDATA[JavaScript]]></category>
        <category domain="tag"><![CDATA[javascript]]></category>
        <category domain="tag" nicename="javascript-2"><![CDATA[javascript]]></category>

@ezy
Copy link

ezy commented Dec 11, 2019

For anyone who isn't clear on the fix for this - it's to remove all instances of <category> xml tags without a domain. Then run your import and it should work as expected.

@curbengh
Copy link
Contributor

v2.1.0 ignores <category> without domain attribute.

categories: ['category[@domain="category" and not(@nicename="uncategorized")]', '.'],

#89

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

4 participants