TryGhost / Ghost

Independent technology for modern publishing, memberships, subscriptions and newsletters.
https://ghost.org
MIT License
47.42k stars 10.35k forks source link

Cannot set property post of #<ListItem> which has only a getter #19404

Closed zeeklog closed 7 months ago

zeeklog commented 10 months ago

Issue Summary

when import data with lab's importer, error occurm import failed:

Cannot set property post of #<ListItem> which has only a getter 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: ---------------------------------------- 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: TypeError: Cannot set property post of #<ListItem> which has only a getter 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at LinkedList.adoptItem [as _adoptItem] (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/models/post.js:41:23) 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at LinkedList.adoptItem (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/linked-list.js:34:14) 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at LinkedList.insertBefore (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/linked-list.js:71:12) 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at LinkedList.append (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/linked-list.js:54:12) 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at DOMParser.appendSection (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:149:23) 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at /home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:133:23 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at Array.forEach (<anonymous>) 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at forEach (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/array-utils.js:53:16) 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at DOMParser.appendSections (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:132:36) 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at /home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:116:15 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at /home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:157:16 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at Proxy.forEach (<anonymous>) 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at forEach (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/array-utils.js:53:16) 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at DOMParser._eachChildNode (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:156:36) 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at DOMParser.parse (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:114:12) 12 25 09:26:48 vankelocalserver-TM1604 node[309143]: at module.exports.toMobiledoc (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/html-to-mobiledoc/lib/converter.js:28:23)

Steps to Reproduce

1、admin page 2、enter setting 3、choose Labs 4、import file 5、check error log

Ghost Version

5.74.2

Node.js Version

18.18.0

How did you install Ghost?

archive

Database type

MySQL 8

Browser & OS version

chrome 120

Relevant log / error output

Cannot set property post of #<ListItem> which has only a getter
12 25 09:26:48 vankelocalserver-TM1604 node[309143]: ----------------------------------------
12 25 09:26:48 vankelocalserver-TM1604 node[309143]: TypeError: Cannot set property post of #<ListItem> which has only a getter
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at LinkedList.adoptItem [as _adoptItem] (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/models/post.js:41:23)
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at LinkedList.adoptItem (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/linked-list.js:34:14)
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at LinkedList.insertBefore (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/linked-list.js:71:12)
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at LinkedList.append (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/linked-list.js:54:12)
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at DOMParser.appendSection (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:149:23)
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at /home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:133:23
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at Array.forEach (<anonymous>)
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at forEach (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/array-utils.js:53:16)
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at DOMParser.appendSections (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:132:36)
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at /home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:116:15
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at /home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:157:16
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at Proxy.forEach (<anonymous>)
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at forEach (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/array-utils.js:53:16)
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at DOMParser._eachChildNode (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:156:36)
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at DOMParser.parse (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:114:12)
12 25 09:26:48 vankelocalserver-TM1604 node[309143]:     at module.exports.toMobiledoc (/home/neo/ghost-cli/test-ghost/node_modules/@tryghost/html-to-mobiledoc/lib/converter.js:28:23)

Code of Conduct

daniellockyer commented 9 months ago

Would you be able to provide a reproduction case for this? What content are you importing?

github-actions[bot] commented 9 months ago

Note from our bot: The needs:info label has been added to this issue. Updating your original issue with more details is great, but won't notify us, so please make sure you leave a comment so that we can see when you've updated us.

cathysarisky commented 7 months ago

I've seen this error triggered by malformed HTML, although I was (trying to) use the API at the time, not the importer. If the OP comes back, it'd be interesting to see the import file that's triggering it. In the one that as bugged for me, I had an <img>inside a <ul>, which is apparently not acceptable HTML!

github-actions[bot] commented 7 months ago

Hey @ethwillupto10000 👋

Our team needed some more info to get to the bottom of this, however we've not heard back from you. We're going to close this for now, but let us know if you manage to dig up some more info and we'll reopen.