Closed emmaengl closed 1 year ago
I have the same issue. Created a new project with only one file as a source of translation strings. Running ngx-translate-extract --input ./projects/xxx --output ./projects/xxx/i18n/{de,fr}.json --sort --clean --format 'namespaced-json' -n --format-indentation ' '"
returns:
An error occurred: TypeError: Cannot read properties of null (reading 'value')
It works after running without -n
resp. --null-as-default-value
flag, but of course, strings are empty by default.
Hi, thanks for the report. Can you confirm that the last working version was?
@michaelbromley for us it was 8.1.1
Paging @SamanthaAdrichem - off the top of your head can you think of anything in your work that might have affected this --null-as-default-value
flag?
No, but its most likely caused by not creating the new interface on the default null values but just null.
it's probably something like
key: null
instead of the new
key: <NewInterface>{value: null, sources: []}
(didn't look at the code, done this from memory so will have many typo's)
I'll push a fix this afternoon
See PR :)
If someone could test it as well, that would be lovely
Just clone the pull request,
git clone git@github.com:SamanthaAdrichem/ngx-translate-extract.git ./ngx-translate-extract
cd ngx-translate-extract
git checkout issue-18
Then run build
npm run build
and then run your script with node for example (assuming you put the folder next to your project folder like so)
.
..
ngx-translate-extract/
your-project/
run it as you always do, just replace the path with
node ../ngx-translate-extract/dist/cli/cli.js YOUR_ARGUMENTS
@SamanthaAdrichem , thanks for getting to this so quickly, can confirm it works for me 🎉
Thanks all for your quick attention! I just released v8.2.2 which contains this fix 👍
Since updating to
8.2.0
thengx-translate-extract
command fails with following error when using the--null-as-default-value
flag:An error occurred: TypeError: Cannot read properties of null (reading 'value')
No issues with parsing pre-existing keys, only on adding new ones. The issue persists on
8.2.1
, my guess is that it's related to the type checking introduced in8.2.0
. Can someone take a look? 🙏