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

Ошибка при скачивании файла Cannot read properties of null (reading 'dispatchEvent') #15

Open
YarMag opened this issue Oct 25, 2022 · 2 comments

Comments

@YarMag
Copy link

YarMag commented Oct 25, 2022

Сегодня скрипт перестал скачивать файлы из фигмы. Доступы есть, токены валидные, смена пользователя результата не дала, в дебаг-папке актуальные скрины и валидный html. Однако любой файл валится с ошибкой вот такого вида:

Starting to process new file (1/493), url: https://www.figma.com/file/file_uuid/
Opening the file page: https://www.figma.com/file/file_uuid/
Returned status: 200
Directory to save the file: ./process/_downloads/MyProject/
Error: Evaluation failed: TypeError: Cannot read properties of null (reading 'dispatchEvent')
at puppeteer_evaluation_script:5:26
at ExecutionContext._evaluateInternal (../tool/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async ExecutionContext.evaluate (../tool/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
at async ../tool/download_figma_files.js:267:13

Проблемы начались сегодня ночью. По исходникам выглядит, как будто скрипт пытается вызвать dispatchEvent на отсутствующем html-элементе, но почему так - вопрос, ибо такой div в верстке на странице присутствует.

Если есть идеи, как этому можно помочь - буду очень благодарен!

@myasnikovdaniil
Copy link

Hello, I've had the same problem - you need to chande css selector in download_figma_files.js 268 line: button element instead of div. It will be like this:

const mainMenu = document.querySelector('button[data-tooltip="main-menu"]');

@azart
Copy link

azart commented Oct 31, 2022

Hello, I've had the same problem - you need to chande css selector in download_figma_files.js 268 line: button element instead of div. It will be like this:

const mainMenu = document.querySelector('button[data-tooltip="main-menu"]');

В версии 0.0.5 описанное выше изменение нужно делать в файле figma_actions.js строка 189

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

3 participants