zenmoney/ZenPlugins

[Kaspi] Babel error when running the plugin locally

Opened this issue · 0 comments

При запуске плагина kaspi локально бабель почему-то не хочет дружить с тайпскриптом. Никак не пойму, в чем проблема. Все зависимости установлены из package.json. Может, версия node.js или webpack не та? Пробовала разные, никак.

➜ yarn start kaspi
yarn run v1.22.22
warning ../../package.json: No license field
$ yarn && node ./scripts/wrapper.js "webpack serve --config ./scripts/webpack.config.js --env PLUGIN=" kaspi
warning ../../package.json: No license field
[1/4] Resolving packages...
success Already up-to-date.
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:8082/, http://127.0.0.1:8082/
<i> [webpack-dev-server] Content not from webpack is served from '/home/fox/dev/ZenPlugins/scripts/public' directory
`isModuleDeclaration` has been deprecated, please migrate to `isImportOrExportDeclaration`
    at isModuleDeclaration (/home/fox/dev/ZenPlugins/node_modules/@babel/types/lib/validators/generated/index.js:2748:35)
    at PluginPass.Program (/home/fox/dev/ZenPlugins/node_modules/babel-plugin-lodash/lib/index.js:102:44)
asset windowLoader.js 1.34 MiB [emitted] [big] (name: windowLoader)
asset vendors-node_modules_es6-iterator_array_js-node_modules_es6-symbol_index_js-node_modules_i18n-3fe33f.chunk.js 585 KiB [emitted] [big] (id hint: vendors)
asset src_XMLHttpRequestViaZenAPI_js-src_asapRawMock_js-src_workerLoader_js.chunk.js 260 KiB [emitted] [big]
asset index.html 644 bytes [emitted]
runtime modules 55.3 KiB 30 modules
modules by path ./node_modules/ 1.22 MiB 367 modules
modules by path ./src/ 164 KiB
  modules by path ./src/*.js 70.5 KiB 18 modules
  modules by path ./src/common/*.js 60.6 KiB 8 modules
  modules by path ./src/UI/*.js 13.9 KiB 6 modules
  modules by path ./src/polyfills/*.js 17.8 KiB 5 modules
  modules by path ./src/plugins/kaspi/ 1.34 KiB 2 modules
json modules 21.5 KiB
  ./locales/de.json 848 bytes [built] [code generated]
  ./locales/en.json 3.1 KiB [built] [code generated]
  ./locales/es.json 2.52 KiB [built] [code generated]
  ./locales/he.json 1.98 KiB [built] [code generated]
  ./locales/pl.json 3.22 KiB [built] [code generated]
  + 3 modules

ERROR in ./src/plugins/kaspi/index.ts
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /home/fox/dev/ZenPlugins/src/plugins/kaspi/index.ts: Missing initializer in const declaration. (9:19)

   7 | import { generateRandomString } from '../../common/utils'
   8 |
>  9 | export const scrape: ScrapeFunc<Preferences> = async ({ fromDate, isFirstRun }) => {
     |                    ^
  10 |   let auth = ZenMoney.getData('auth') as Auth | undefined
  11 |   if (!auth || auth.deviceId === '') {
  12 |     auth = {
    at toParseError (/home/fox/dev/ZenPlugins/node_modules/@babel/parser/src/parse-error.ts:74:19)
    at Parser.raise (/home/fox/dev/ZenPlugins/node_modules/@babel/parser/src/tokenizer/index.ts:1497:19)
    at Parser.parseVar (/home/fox/dev/ZenPlugins/node_modules/@babel/parser/src/parser/statement.ts:1550:16)
    at Parser.parseVarStatement (/home/fox/dev/ZenPlugins/node_modules/@babel/parser/src/parser/statement.ts:1196:10)
    at Parser.parseStatementContent (/home/fox/dev/ZenPlugins/node_modules/@babel/parser/src/parser/statement.ts:550:21)
    at Parser.parseStatementLike (/home/fox/dev/ZenPlugins/node_modules/@babel/parser/src/parser/statement.ts:421:17)
    at Parser.parseStatementListItem (/home/fox/dev/ZenPlugins/node_modules/@babel/parser/src/parser/statement.ts:370:17)
    at Parser.parseExportDeclaration (/home/fox/dev/ZenPlugins/node_modules/@babel/parser/src/parser/statement.ts:2558:17)
    at Parser.maybeParseExportDeclaration (/home/fox/dev/ZenPlugins/node_modules/@babel/parser/src/parser/statement.ts:2480:31)
    at Parser.parseExport (/home/fox/dev/ZenPlugins/node_modules/@babel/parser/src/parser/statement.ts:2364:29)
 @ ./src/plugins/kaspi/ZenmoneyManifest.xml 3:13-31
 @ ./src/handleMessageFromWindow.js 27:12-44
 @ ./src/workerLoader.js 1:0-68 2:44-67
 @ ./src/windowLoader.js 100:19-73

webpack 5.91.0 compiled with 1 error in 10490 ms