2 минуты ротацию вообще брать не рекомендуется. Для 5 минут еще можно придумать, но тоже такое.
BAS выдает ошибку на версии старше 24.2.2 с node и node module
-
Скрипт использует node и модуль node-fetch. Скрипт работает на версии 24.1.1 и не работает на 24.2.2 и старше, выдает ошибку:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\Andrey\AppData\Roaming\BrowserAutomationStudio\apps\24.2.3\e\896c.H1qP\distr\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of C:\Users\Andrey\AppData\Roaming\BrowserAutomationStudio\apps\24.2.3\e\896c.H1qP\distr\node_modules\node-fetch\src\index.js from C:\Users\Andrey\AppData\Roaming\BrowserAutomationStudio\apps\24.2.3\e\896c.H1qP\distr\lib\custom\3slzmjnyo5z.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\Andrey\AppData\Roaming\BrowserAutomationStudio\apps\24.2.3\e\896c.H1qP\distr\node_modules\node-fetch\package.json.Файл с примером
fortest.zip -
@Andrey-0 said in BAS выдает ошибку на версии старше 24.2.2 с node и node module:
Скрипт использует node и модуль node-fetch. Скрипт работает на версии 24.1.1 и не работает на 24.2.2 и старше, выдает ошибку:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\Andrey\AppData\Roaming\BrowserAutomationStudio\apps\24.2.3\e\896c.H1qP\distr\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of C:\Users\Andrey\AppData\Roaming\BrowserAutomationStudio\apps\24.2.3\e\896c.H1qP\distr\node_modules\node-fetch\src\index.js from C:\Users\Andrey\AppData\Roaming\BrowserAutomationStudio\apps\24.2.3\e\896c.H1qP\distr\lib\custom\3slzmjnyo5z.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\Andrey\AppData\Roaming\BrowserAutomationStudio\apps\24.2.3\e\896c.H1qP\distr\node_modules\node-fetch\package.json.Файл с примером
fortest.zipУ меня эту ошибку выдаёт и на 24.1.1 версии

и даже на 23.2.2

-
@Andrey-0, https://www.npmjs.com/package/node-fetch#installation, рабочий вариант:
const {default: fetch} = await import('node-fetch');или использовать fetch ниже 3 версииПример: fortest.xml