jshmrtn / vue3-gettext

Translate Vue 3 applications with gettext.
https://jshmrtn.github.io/vue3-gettext/
MIT License
70 stars 24 forks source link

tslib.__spreadArray is not a function when running extraction. #15

Closed tcitworld closed 2 years ago

tcitworld commented 2 years ago

Running on 2.0.0-alpha.3

vue-gettext-extract
Input directory: ./src
Output directory: ./src/locale
Output POT file: src/locale/messages.pot
Locales: bn,de,el,en_US,es,fr_FR,fy,gd,gl,id,it,ja,nl,oc,pl,pt_BR,ru,sq,sv,th

Searching: src/**/*.js
Searching: src/**/*.ts
Searching: src/**/*.vue
~project/node_modules/vue3-gettext/dist/bin/gettext_extract.js:274
                filesFlat = allFiles.reduce(function (prev, curr) { return tslib.__spreadArray(tslib.__spreadArray([], prev, true), curr, true); }, []);
                                                                                                     ^

TypeError: tslib.__spreadArray is not a function
    at ~project/node_modules/vue3-gettext/dist/bin/gettext_extract.js:274:102
    at Array.reduce (<anonymous>)
    at ~project/node_modules/vue3-gettext/dist/bin/gettext_extract.js:274:38
    at step (~project/node_modules/tslib/tslib.js:141:27)
    at Object.next (~project/node_modules/tslib/tslib.js:122:57)
    at fulfilled (~project/node_modules/tslib/tslib.js:112:62)

Seems related to https://github.com/microsoft/tslib/issues/149

tcitworld commented 2 years ago

I fixed it by bumping dependencies in https://github.com/jshmrtn/vue3-gettext/pull/16

lzurbriggen commented 2 years ago

@tcitworld I coudn't easily reproduce this, but I released v2.0.0-beta.1 with the bumped dependencies.

Please let me know if the issue persists.

lzurbriggen commented 2 years ago

I reproduced the issue in one of our projects -> reopen.

lzurbriggen commented 2 years ago

Fixed in v2.0.0-beta.2