Aws cognito angular example: URIError: URI is invalid
I was testing a sample aws cognito app based on angular 2 and noticed the following error.
App https://github.com/awslabs/aws-cognito-angular2-quickstart
When I try to navigate to this app deployed to http://cognito.budilov.com/ from the Chrome browser on my Android I get the following error. Any ideas on what might be going on?
vendor.f06d8c6….bundle.js:148 ERROR Error: Uncaught (in promise): URIError:
URI malformed
URIError: URI malformed
at decodeURIComponent (<anonymous>)
at Object.fromBits (sjcl.js:11)
at e.value (amazon-cognito-identity.min.js:19)
at e.value (amazon-cognito-identity.min.js:19)
at e.value (amazon-cognito-identity.min.js:19)
at l.O7AO.l.isAuthenticated (main.fd38a9f….bundle.js:1)
at new l (main.fd38a9f….bundle.js:1)
at Ze (vendor.f06d8c6….bundle.js:225)
at ze (vendor.f06d8c6….bundle.js:225)
at On (vendor.f06d8c6….bundle.js:239)
at _n (vendor.f06d8c6….bundle.js:239)
at Object.Hn [as createRootView] (vendor.f06d8c6….bundle.js:239)
at e.create (vendor.f06d8c6….bundle.js:302)
at e.create (vendor.f06d8c6….bundle.js:281)
at t.createComponent (vendor.f06d8c6….bundle.js:302)
at decodeURIComponent (<anonymous>)
at Object.fromBits (sjcl.js:11)
at e.value (amazon-cognito-identity.min.js:19)
at e.value (amazon-cognito-identity.min.js:19)
at e.value (amazon-cognito-identity.min.js:19)
at l.O7AO.l.isAuthenticated (main.fd38a9f….bundle.js:1)
at new l (main.fd38a9f….bundle.js:1)
at Ze (vendor.f06d8c6….bundle.js:225)
at ze (vendor.f06d8c6….bundle.js:225)
at On (vendor.f06d8c6….bundle.js:239)
at _n (vendor.f06d8c6….bundle.js:239)
at Object.Hn [as createRootView] (vendor.f06d8c6….bundle.js:239)
at e.create (vendor.f06d8c6….bundle.js:302)
at e.create (vendor.f06d8c6….bundle.js:281)
at t.createComponent (vendor.f06d8c6….bundle.js:302)
at v (vendor.f06d8c6….bundle.js:697)
at p (vendor.f06d8c6….bundle.js:697)
at p (vendor.f06d8c6….bundle.js:697)
at vendor.f06d8c6….bundle.js:697
at t.invokeTask (vendor.f06d8c6….bundle.js:697)
at Object.onInvokeTask (vendor.f06d8c6….bundle.js:281)
at t.invokeTask (vendor.f06d8c6….bundle.js:697)
at e.runTask (vendor.f06d8c6….bundle.js:697)
at a (vendor.f06d8c6….bundle.js:697)
at HTMLAnchorElement.invoke (vendor.f06d8c6….bundle.js:697)
UPDATE:
This works fine with the unminified js version of the aws cognito identity js file, but still a problem with the minified version.
+3
source to share
1 answer
Updating to the latest version of aws-cognito-sdk.js and amazon-cognito-identity.js solves the issue.
You can get them from this repository https://github.com/aws/amazon-cognito-identity-js
+4
source to share