Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Partial loading can fail silently without any hints #1917

Open
boindil opened this issue Feb 7, 2023 · 1 comment
Open

Partial loading can fail silently without any hints #1917

boindil opened this issue Feb 7, 2023 · 1 comment

Comments

@boindil
Copy link

boindil commented Feb 7, 2023

Subject of the issue

Partial loading can fail silently without any hints. This happens, when there are conflicting keys being merged. This would not be a big issue in case there would be an error message at least. However

Your environment

  • version of angular-translate: 2.19.0
  • version of angular: 1.8.3
  • which browser and its version: not relevant

Steps to reproduce

Use at least two partiuals:

{"foo": {"bar": "baz"}}
{"foo": {"bar": {"baz": "bat"}}}

Expected behaviour

At least throw an error.

Actual behaviour

No error message (last seen at

$rootScope.$emit('$translateLoadingError', {language : key});
), no translations at all. Makes it really hard to debug.

TypeError: Cannot create property 'baz' on string 'baz'
    at deepExtend (angular-translate-loader-partial.js:170:23)
    at deepExtend (angular-translate-loader-partial.js:168:9)
    at deepExtend (angular-translate-loader-partial.js:168:9)
    at angular-translate-loader-partial.js:399:15
    at Object.r [as forEach] (angular.min.js:8:76)
    at angular-translate-loader-partial.js:398:21
    at angular.min.js:140:235
    at m.$digest (angular.min.js:151:385)
    at m.$apply (angular.min.js:155:259)
    at k (angular.min.js:106:309)
@knalli
Copy link
Member

knalli commented Feb 10, 2023

Hi @boindil

What do you mean? Does the emitting of translateLoadingError not work? Or did you expect an error in the console instead of that?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants