seratch / notion-translator

CLI tool to translate Notion pages into a different language
MIT License
71 stars 20 forks source link

Cannot read properties of undefined (reading 'title') #12

Open mannipulator opened 1 year ago

mannipulator commented 1 year ago

Hello again ;)

first of all: Thanks for this blazing fast bugfix today, that seems to work.

Now I found this error-message:

C:\Users\user1\Documents\NotionTranslator>notion-translator --from en --to id --url https://www.notion.so/MyNotionPage

Wait a minute! Now translating the following Notion page:
https://www.notion.so/MyNotionPage

(this may take some time) ...........C:\Users\user1\AppData\Roaming\npm\node_modules\notion-translator\index.js:376
  const newTitle = newPage.properties.title.title[0];
                                            ^

TypeError: Cannot read properties of undefined (reading 'title')
    at createNewPageForTranslation (C:\Users\user1\AppData\Roaming\npm\node_modules\notion-translator\index.js:376:45)
    at C:\Users\user1\AppData\Roaming\npm\node_modules\notion-translator\index.js:421:25
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.8.0
RelohDev commented 1 year ago

Hello, I've got the same error 😉

root@3c1b4c787426:~# notion-translator   --from en   --to pl   --url https://www.notion.so/reloh/Navigating-the-WebUI-f3137476e4fa4c17a452965bed42fb8f   

Wait a minute! Now translating the following Notion page:
https://www.notion.so/reloh/Navigating-the-WebUI-f3137476e4fa4c17a452965bed42fb8f

(this may take some time) ........./usr/local/lib/node_modules/notion-translator/index.js:376
  const newTitle = newPage.properties.title.title[0];
                                            ^

TypeError: Cannot read properties of undefined (reading 'title')
    at createNewPageForTranslation (/usr/local/lib/node_modules/notion-translator/index.js:376:45)
    at /usr/local/lib/node_modules/notion-translator/index.js:421:25
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.8.0
mannipulator commented 1 year ago

Does anyone have a workaround for that bug?

Domnin-unchain commented 10 months ago

Hi, I have the same issue. Did you find a solution?

nazmy-achmad commented 9 months ago

I'm facing the same issue

Mys1ery commented 1 week ago

i got the same issue image

Mys1ery commented 1 week ago

i fix this bug. image for me, just replace "newPage.properties.title.title[0]" with "newPage.properties.Name.title[0]", then it will work well