Angular 9 - Unhandled Promise rejection: this._input.charCodeAt is not a function
See original GitHub issueHi guys,
Today we tried upgrading to Angular 9 and It required us to install @angular/localize
( not sure if this is related)
However, after running ng update @angular/core @angular/cli
, we don’t seem to hit any errors except for one that seems to be coming from this polyfill.
The full error is:
zone.js:699 Unhandled Promise rejection: this._input.charCodeAt is not a function ; Zone: <root> ; Task: Promise.then ; Value: TypeError: this._input.charCodeAt is not a function
at Tokenizer.push../node_modules/@ngx-translate/i18n-polyfill/__ivy_ngcc__/fesm5/ngx-translate-i18n-polyfill.js.Tokenizer._advance (ngx-translate-i18n-polyfill.js:1370)
at new Tokenizer (ngx-translate-i18n-polyfill.js:1184)
at tokenize (ngx-translate-i18n-polyfill.js:1136)
at Parser.push../node_modules/@ngx-translate/i18n-polyfill/__ivy_ngcc__/fesm5/ngx-translate-i18n-polyfill.js.Parser.parse (ngx-translate-i18n-polyfill.js:2160)
at XliffParser.push../node_modules/@ngx-translate/i18n-polyfill/__ivy_ngcc__/fesm5/ngx-translate-i18n-polyfill.js.XliffParser.parse (ngx-translate-i18n-polyfill.js:3651)
at xliffLoadToI18n (ngx-translate-i18n-polyfill.js:3622)
at Function.push../node_modules/@ngx-translate/i18n-polyfill/__ivy_ngcc__/fesm5/ngx-translate-i18n-polyfill.js.TranslationBundle.load (ngx-translate-i18n-polyfill.js:7748)
at new I18n (ngx-translate-i18n-polyfill.js:8478)
at Function.I18n_Factory [as ɵfac] (ngx-translate-i18n-polyfill.js:8504)
at Object.factory (ngx-translate-i18n-polyfill.js:8505) TypeError: this._input.charCodeAt is not a function
at Tokenizer.push../node_modules/@ngx-translate/i18n-polyfill/__ivy_ngcc__/fesm5/ngx-translate-i18n-polyfill.js.Tokenizer._advance (http://localhost:4000/vendor.js:86129:71)
at new Tokenizer (http://localhost:4000/vendor.js:85943:14)
at tokenize (http://localhost:4000/vendor.js:85895:12)
at Parser.push../node_modules/@ngx-translate/i18n-polyfill/__ivy_ngcc__/fesm5/ngx-translate-i18n-polyfill.js.Parser.parse (http://localhost:4000/vendor.js:86919:48)
at XliffParser.push../node_modules/@ngx-translate/i18n-polyfill/__ivy_ngcc__/fesm5/ngx-translate-i18n-polyfill.js.XliffParser.parse (http://localhost:4000/vendor.js:88410:71)
at xliffLoadToI18n (http://localhost:4000/vendor.js:88381:26)
at Function.push../node_modules/@ngx-translate/i18n-polyfill/__ivy_ngcc__/fesm5/ngx-translate-i18n-polyfill.js.TranslationBundle.load (http://localhost:4000/vendor.js:92507:49)
at new I18n (http://localhost:4000/vendor.js:93237:69)
at Function.I18n_Factory [as ɵfac] (http://localhost:4000/vendor.js:93263:47)
at Object.factory (http://localhost:4000/vendor.js:93264:130)
Did anyone stumble on this same issue perhaps, while updating to Angular 9 - and has a solution for it?
Or does this require an update on the polyfill from your side, @ocombe
Big thanks in advance!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:24 (3 by maintainers)
Top Results From Across the Web
Uncaught TypeError: this._input.charCodeAt is not a function
Might be caused by loading component code instead of template, i.e. templateUrl: 'my.component'. instead of
Read more >Uncaught Typeerror: This._Input.Charcodeat Is Not ... - ADocLib
A TypeError may be thrown when: an operand or argument passed to a function is incompatible with the type expected by that operator...
Read more >TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >TypeError: charAt is not a function in JavaScript | bobbyhadz
The "charAt is not a function" error occurs when we call the `charAt()` method on a value that is not a string. To...
Read more >Uncaught TypeError | Is Not A Function | Solution - YouTube
Have you encountered an error like:- Uncaught TypeError- Some selector is not a function - jQuery is not a function - owlCarousel is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That was new feature for me. Thanks. Here it is. It assume that you have named I18n by i18n. In my case some has used i18 for some reason. ANd also some has used public instead of private. https://gist.github.com/JanneHarju/fd17609a81d50ae34f6b32c3c5d8284a
@ocombe We loved the polyfill but are migrating to angular 9. In that regard it be super helpful for others if you could update the polyfill documentation to point out that:
$localize`::@@some-id:source text`
While the information is available, it took us a while to assemble it all together.