Coder Social home page Coder Social logo

Amplify v6 - TypeError: Cannot read property 'decode' of undefined (underlying error response from `signIn` method) about amplify-js HOT 8 OPEN

langerkirill avatar langerkirill commented on June 12, 2024
Amplify v6 - TypeError: Cannot read property 'decode' of undefined (underlying error response from `signIn` method)

from amplify-js.

Comments (8)

langerkirill avatar langerkirill commented on June 12, 2024 1

@cwomack I added you as a collaborator to a sample repo where you can reproduce this issue yourself. You should be able to pull it down and follow the instructions I will add to the README to reproduce the issue. Thanks.

from amplify-js.

langerkirill avatar langerkirill commented on June 12, 2024 1

My issues were resolved by implementing the suggestion in the following comment:

aws/aws-sdk-js-v3#4877 (comment)

from amplify-js.

cwomack avatar cwomack commented on June 12, 2024 1

@langerkirill, glad you found the workaround already! We'll mark this as a bug on our side due to the dependencies in our library on the aws-sdk. We're tracking this internally and will update this issue when a fix is released on our side that updates our dependencies.

In the mean time, if anyone comes across this same blocker please refer to this comment for a workaround.

from amplify-js.

cwomack avatar cwomack commented on June 12, 2024

Hey, @langerkirill and thanks for opening this issue. The decode method in React Native is vended by base-64 package which is a dependency of @aws-amplify/react-native. Can you see if deleting your node_modules folder, as well as your package-lock.json file, then reinstalling dependences with npm install resolves the error?

If it doesn't, possibly verify you have the necessary dependency with npm why base-64 as well.

from amplify-js.

langerkirill avatar langerkirill commented on June 12, 2024

Hi @cwomack, thanks for the response. I tried deleting node_modules and yarn.lock, no luck. I got the same error. It does appear that I have base-64:

Mobile git:2890-slow-login ❯ yarn why base-64                                                                              ✹ ✭
yarn why v1.22.22
warning ../../package.json: No license field
[1/4] 🤔  Why do we have the module "base-64"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
   - "@aws-amplify#react-native" depends on it
   - Hoisted from "@aws-amplify#react-native#base-64"
info Disk size without dependencies: "20KB"
info Disk size with unique dependencies: "20KB"
info Disk size with transitive dependencies: "20KB"
info Number of shared dependencies: 0
✨  Done in 0.29s.

from amplify-js.

cwomack avatar cwomack commented on June 12, 2024

@langerkirill, are you able to provide a sample repo possibly that can reproduce this reliably? We haven't been able to reproduce it on our side with a React Native app. Can you also clarify if you're calling Amplify.configure() at the root of your app as well?

from amplify-js.

langerkirill avatar langerkirill commented on June 12, 2024

@cwomack, we are unable to call Amplify.configure() in the root of our app because our app requires that users input a Facility ID on the first page which we then need to use to fetch information that we pass into the Amplify configuration. We have different userpoolid values for users in different regions for example. We need to configure Amplify on the second page before sign in. This was never an issue with v4. Do you think it may have become an issue for v6?

I will see about getting you a sample repo.

from amplify-js.

langerkirill avatar langerkirill commented on June 12, 2024

I found another error in the debug console mode related to an undefined URL.

Screenshot 2024-03-20 at 5 39 59 PM

from amplify-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.