Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular dependencies introduced with 6.10.0 to @aws-amplify/auth #14150

Open
3 tasks done
mia-iofinnet opened this issue Jan 20, 2025 · 14 comments
Open
3 tasks done

Circular dependencies introduced with 6.10.0 to @aws-amplify/auth #14150

mia-iofinnet opened this issue Jan 20, 2025 · 14 comments
Assignees
Labels
Core Related to core Amplify issues dependencies Pull requests that update a dependency file question General question

Comments

@mia-iofinnet
Copy link

Before opening, please confirm:

JavaScript Framework

React Native

Amplify APIs

Authentication

Amplify Version

v6

Amplify Categories

auth

Backend

None

Environment information

# Put output below this line
  System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Pro
    Memory: 354.34 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.13.0 - ~/.nvm/versions/node/v22.13.0/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v22.13.0/bin/npm
    pnpm: 9.15.3 - ~/.nvm/versions/node/v22.13.0/bin/pnpm
  Browsers:
    Chrome: 132.0.6834.84
    Safari: 18.2
  npmPackages:
    @apollo/client: ^3.12.6 => 3.12.6 
    @apollo/client/cache:  undefined ()
    @apollo/client/core:  undefined ()
    @apollo/client/dev:  undefined ()
    @apollo/client/errors:  undefined ()
    @apollo/client/link/batch:  undefined ()
    @apollo/client/link/batch-http:  undefined ()
    @apollo/client/link/context:  undefined ()
    @apollo/client/link/core:  undefined ()
    @apollo/client/link/error:  undefined ()
    @apollo/client/link/http:  undefined ()
    @apollo/client/link/persisted-queries:  undefined ()
    @apollo/client/link/remove-typename:  undefined ()
    @apollo/client/link/retry:  undefined ()
    @apollo/client/link/schema:  undefined ()
    @apollo/client/link/subscriptions:  undefined ()
    @apollo/client/link/utils:  undefined ()
    @apollo/client/link/ws:  undefined ()
    @apollo/client/masking:  undefined ()
    @apollo/client/react:  undefined ()
    @apollo/client/react/components:  undefined ()
    @apollo/client/react/context:  undefined ()
    @apollo/client/react/hoc:  undefined ()
    @apollo/client/react/hooks:  undefined ()
    @apollo/client/react/internal:  undefined ()
    @apollo/client/react/parser:  undefined ()
    @apollo/client/react/ssr:  undefined ()
    @apollo/client/testing:  undefined ()
    @apollo/client/testing/core:  undefined ()
    @apollo/client/testing/experimental:  undefined ()
    @apollo/client/utilities:  undefined ()
    @apollo/client/utilities/globals:  undefined ()
    @apollo/client/utilities/subscriptions/relay:  undefined ()
    @apollo/client/utilities/subscriptions/urql:  undefined ()
    @aws-amplify/react-native: ^1.1.6 => 1.1.6 
    @aws-amplify/ui-react-native: ^2.4.0 => 2.4.0 
    @aws-sdk/client-sns: ^3.731.1 => 3.731.1 
    @babel/core: ^7.26.0 => 7.26.0 
    @config-plugins/apple-settings: ^3.0.0 => 3.0.0 
    @expo-google-fonts/space-grotesk: ^0.2.3 => 0.2.3 
    @expo-google-fonts/space-mono: ^0.2.3 => 0.2.3 
    @formatjs/intl-getcanonicallocales: ^2.5.4 => 2.5.4 
    @formatjs/intl-locale: ^4.2.9 => 4.2.9 
    @formatjs/intl-numberformat: ^8.15.2 => 8.15.2 
    @formatjs/intl-pluralrules: ^5.4.2 => 5.4.2 
    @formatjs/intl-relativetimeformat: ^11.4.9 => 11.4.9 
    @formatjs/ts-transformer: ^3.13.30 => 3.13.30 
    @fullstory/react-native: ^1.7.2 => 1.7.2 
    @graphql-codegen/cli: ^5.0.3 => 5.0.3 
    @graphql-codegen/client-preset: ^4.5.1 => 4.5.1 
    @iofinnet/expo-tss: 2.18.5 => 2.18.5 
    @react-native-async-storage/async-storage: 1.23.1 => 1.23.1 
    @react-native-community/netinfo: 11.4.1 => 11.4.1 
    @react-native-google-signin/google-signin: ^13.1.0 => 13.1.0 
    @react-native-segmented-control/segmented-control: 2.5.4 => 2.5.4 
    @reduxjs/toolkit: ^2.5.0 => 2.5.0 
    @reduxjs/toolkit-query:  1.0.0 
    @reduxjs/toolkit-query-react:  1.0.0 
    @reduxjs/toolkit-react:  1.0.0 
    @scure/bip39: ^1.5.4 => 1.5.4 
    @sentry/react-native: ~6.3.0 => 6.3.0 
    @shopify/restyle: ^2.4.4 => 2.4.4 
    @tanstack/query-codemods:  undefined ()
    @tanstack/react-query: ^5.64.2 => 5.64.2 
    @types/crypto-js: ^4.2.2 => 4.2.2 
    @types/deep-equal: ^1.0.4 => 1.0.4 
    @types/jest: ^29.5.12 => 29.5.14 
    @types/lodash.debounce: ^4.0.9 => 4.0.9 
    @types/lodash.isequal: ^4.5.8 => 4.5.8 
    @types/lodash.throttle: ^4.1.9 => 4.1.9 
    @types/luxon: ^3.4.2 => 3.4.2 
    @types/md5: ^2.3.5 => 2.3.5 
    @types/mersenne-twister: ^1.1.7 => 1.1.7 
    @types/react: ~18.3.12 => 18.3.12 
    @types/sha1: ^1.1.5 => 1.1.5 
    @types/text-encoding: ^0.0.40 => 0.0.40 
    @types/uuid: ^10.0.0 => 10.0.0 (9.0.8)
    FreeraspReactNativeExample:  0.0.1 
    async-mutex: ^0.5.0 => 0.5.0 
    aws-amplify: ~6.9.0 => 6.9.0 
    aws-amplify/adapter-core:  undefined ()
    aws-amplify/analytics:  undefined ()
    aws-amplify/analytics/kinesis:  undefined ()
    aws-amplify/analytics/kinesis-firehose:  undefined ()
    aws-amplify/analytics/personalize:  undefined ()
    aws-amplify/analytics/pinpoint:  undefined ()
    aws-amplify/api:  undefined ()
    aws-amplify/api/server:  undefined ()
    aws-amplify/auth:  undefined ()
    aws-amplify/auth/cognito:  undefined ()
    aws-amplify/auth/cognito/server:  undefined ()
    aws-amplify/auth/enable-oauth-listener:  undefined ()
    aws-amplify/auth/server:  undefined ()
    aws-amplify/data:  undefined ()
    aws-amplify/data/server:  undefined ()
    aws-amplify/datastore:  undefined ()
    aws-amplify/in-app-messaging:  undefined ()
    aws-amplify/in-app-messaging/pinpoint:  undefined ()
    aws-amplify/push-notifications:  undefined ()
    aws-amplify/push-notifications/pinpoint:  undefined ()
    aws-amplify/storage:  undefined ()
    aws-amplify/storage/s3:  undefined ()
    aws-amplify/storage/s3/server:  undefined ()
    aws-amplify/storage/server:  undefined ()
    aws-amplify/utils:  undefined ()
    aws-appsync-auth-link: ^3.0.7 => 3.0.7 
    aws-appsync-subscription-link: ^3.1.3 => 3.1.3 
    babel-plugin-react-compiler: ^19.0.0-beta-e552027-20250112 => 19.0.0-beta-e552027-20250112 
    bignumber.js: ^9.1.2 => 9.1.2 
    buffer: ^6.0.3 => 6.0.3 (4.9.2, 5.7.1)
    crypto-js: ^4.2.0 => 4.2.0 
    deep-equal: ^2.2.3 => 2.2.3 
    deepmerge: ^4.3.1 => 4.3.1 
    eslint: ^8.57.0 => 8.57.1 
    eslint-config-universe: ^12.1.0 => 12.1.0 
    eslint-import-resolver-typescript: ^3.7.0 => 3.7.0 
    eslint-plugin-react-compiler: ^19.0.0-beta-e552027-20250112 => 19.0.0-beta-e552027-20250112 
    eslint-plugin-unicorn: ^51.0.1 => 51.0.1 
    expo: ~52.0.26 => 52.0.26 
    expo-application: ~6.0.2 => 6.0.2 
    expo-build-properties: ~0.13.2 => 0.13.2 
    expo-clipboard: ~7.0.1 => 7.0.1 
    expo-constants: ~17.0.4 => 17.0.4 
    expo-crypto: ~14.0.2 => 14.0.2 
    expo-dev-client: ~5.0.9 => 5.0.9 
    expo-device: ~7.0.2 => 7.0.2 
    expo-haptics: ~14.0.1 => 14.0.1 
    expo-insights: ~0.8.2 => 0.8.2 
    expo-keep-awake: ~14.0.2 => 14.0.2 
    expo-linear-gradient: ~14.0.2 => 14.0.2 
    expo-linking: ~7.0.4 => 7.0.4 
    expo-local-authentication: ~15.0.2 => 15.0.2 
    expo-localization: ~16.0.1 => 16.0.1 
    expo-location: ~18.0.5 => 18.0.5 
    expo-notifications: ~0.29.12 => 0.29.12 
    expo-router: ~4.0.17 => 4.0.17 
    expo-secure-store: ~14.0.1 => 14.0.1 
    expo-sharing: ~13.0.1 => 13.0.1 
    expo-splash-screen: ~0.29.21 => 0.29.21 
    expo-status-bar: ~2.0.1 => 2.0.1 
    expo-system-ui: ~4.0.7 => 4.0.7 
    expo-task-manager: ~12.0.4 => 12.0.4 
    expo-updates: ~0.26.13 => 0.26.13 
    exponential-backoff: ^3.1.1 => 3.1.1 
    freerasp-react-native: ^3.13.0 => 3.13.0 
    google-protobuf: ^3.21.4 => 3.21.4 
    graphql: ^16.10.0 => 16.10.0 (15.8.0)
    jest: ^29.7.0 => 29.7.0 
    jest-expo: 52.0.3 => 52.0.3 
    jszip: ^3.10.1 => 3.10.1 
    lodash.debounce: ^4.0.8 => 4.0.8 
    lodash.isequal: ^4.5.0 => 4.5.0 
    lodash.throttle: ^4.1.1 => 4.1.1 
    lottie-react-native: 7.1.0 => 7.1.0 
    luxon: ^3.5.0 => 3.5.0 
    md5: ^2.3.0 => 2.3.0 
    mersenne-twister: ^1.1.0 => 1.1.0 
    pino: ^9.6.0 => 9.6.0 
    prettier: ^3.4.2 => 3.4.2 
    react: 18.3.1 => 18.3.1 
    react-compiler-runtime: ^19.0.0-beta-e552027-20250112 => 19.0.0-beta-e552027-20250112 
    react-intl: ^7.1.3 => 7.1.3 
    react-native: 0.76.1 => 0.76.1 
    react-native-aes-crypto: 3.2.1 => 3.2.1 
    react-native-aes-gcm-crypto: ^0.2.2 => 0.2.2 
    react-native-cloud-storage: ^2.2.1 => 2.2.1 
    react-native-edge-to-edge: ^1.4.2 => 1.4.2 
    react-native-gesture-handler: ~2.20.2 => 2.20.2 
    react-native-get-random-values: ~1.11.0 => 1.11.0 
    react-native-nfc-manager: ^3.16.1 => 3.16.1 
    react-native-reanimated: ~3.16.3 => 3.16.3 
    react-native-safe-area-context: 4.12.0 => 4.12.0 
    react-native-screens: ^4.4.0 => 4.4.0 
    react-native-svg: 15.8.0 => 15.8.0 
    react-native-svg-transformer: ^1.5.0 => 1.5.0 
    react-native-url-polyfill: ^2.0.0 => 2.0.0 
    react-native-webview: 13.12.5 => 13.12.5 
    react-redux: ^9.2.0 => 9.2.0 
    redux: ^5.0.1 => 5.0.1 
    redux-persist: ^6.0.0 => 6.0.0 
    redux-persist/integration/react:  undefined ()
    sanitize-filename: ^1.6.3 => 1.6.3 
    sha1: ^1.1.1 => 1.1.1 
    sonner-native: ^0.16.2 => 0.16.2 
    tempy: ^3.1.0 => 3.1.0 (0.7.1)
    text-encoding: ^0.7.0 => 0.7.0 
    transport:  0.0.1 
    typescript: ~5.3.3 => 5.3.3 
    uuid: 11.0.5 => 11.0.5 
    zod: ^3.24.1 => 3.24.1 
  npmGlobalPackages:
    @aws-amplify/cli: 12.14.1
    corepack: 0.30.0
    eas-cli: 14.4.1
    npm: 10.9.2
    vercel: 39.3.0

Describe the bug

We were seeing and error TypeError: setActiveSignInUsername is not a function (it is undefined) when trying to update to version 6.10.0 of aws-amplify or later.

After some debugging, we noticed that all the items imported from src/providers/cognito/utils/signInHelpers.ts into src/client/flows/shared/handlePasswordSRP.ts were undefined at runtime.

The we ran the following command to analyze circular dependencies in the project:

npx dpdm -T --no-tree --no-warning --exclude "node_modules/react-native" src/app/**/*.tsx | grep 'aws-amplify'

Whereas when using 6.9.0, the output of that command is empty, when switching to 6.10.0 it becomes:

✔ [3588/3588] Analyze done!
  28) node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInHelpers.mjs -> node_modules/@aws-amplify/auth/dist/esm/client/flows/userAuth/handleWebAuthnSignInResult.mjs
  29) node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInHelpers.mjs -> node_modules/@aws-amplify/auth/dist/esm/client/flows/shared/handlePasswordSRP.mjs
  30) node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInHelpers.mjs -> node_modules/@aws-amplify/auth/dist/esm/client/flows/userAuth/handleSelectChallengeWithPassword.mjs
  31) node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInHelpers.mjs -> node_modules/@aws-amplify/auth/dist/esm/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.mjs
  36) node_modules/@aws-amplify/auth/dist/cjs/providers/cognito/utils/signInHelpers.js -> node_modules/@aws-amplify/auth/dist/cjs/client/flows/userAuth/handleWebAuthnSignInResult.js
  37) node_modules/@aws-amplify/auth/dist/cjs/providers/cognito/utils/signInHelpers.js -> node_modules/@aws-amplify/auth/dist/cjs/client/flows/shared/handlePasswordSRP.js
  38) node_modules/@aws-amplify/auth/dist/cjs/providers/cognito/utils/signInHelpers.js -> node_modules/@aws-amplify/auth/dist/cjs/client/flows/userAuth/handleSelectChallengeWithPassword.js
  39) node_modules/@aws-amplify/auth/dist/cjs/providers/cognito/utils/signInHelpers.js -> node_modules/@aws-amplify/auth/dist/cjs/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.js

Expected behavior

  • Signing in with SRP flow works normally when upgrading from 6.9.0 to 6.10.0.
  • Running npx dpdm -T --no-tree --no-warning packages/auth/src/index.ts against the source of this repo does not report any circular dependencies.

Reproduction steps

  1. Clone this repo.
  2. Checkout tag [email protected].
  3. Run npx dpdm -T --no-tree --no-warning packages/auth/src/index.ts. No circular dependencies will be reported.
  4. Checkout tag [email protected] or any other later version.
  5. Run npx dpdm -T --no-tree --no-warning packages/auth/src/index.ts. Circular dependencies will be reported:
    • Circular Dependencies
      1) packages/auth/src/providers/cognito/utils/signInHelpers.ts -> packages/auth/src/client/flows/userAuth/handleWebAuthnSignInResult.ts
      2) packages/auth/src/providers/cognito/utils/signInHelpers.ts -> packages/auth/src/client/flows/shared/handlePasswordSRP.ts
      3) packages/auth/src/providers/cognito/utils/signInHelpers.ts -> packages/auth/src/client/flows/userAuth/handleSelectChallengeWithPassword.ts
      4) packages/auth/src/providers/cognito/utils/signInHelpers.ts -> packages/auth/src/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.ts
    

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending a response from the Amplify team. labels Jan 20, 2025
@cwomack cwomack self-assigned this Jan 20, 2025
@cwomack cwomack added Core Related to core Amplify issues dependencies Pull requests that update a dependency file labels Jan 20, 2025
@jjarvisp
Copy link
Member

Hey @mia-iofinnet, thank you for opening this issue. We are looking into this on our side. Are you able to provide any additional details about the build configuration for your application? Thanks!

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Jan 20, 2025
@jjarvisp
Copy link
Member

I was able to replicate the issue described above when I enabled the experimental react compiler in an expo application. Are you using react compiler as well? As a temporary workaround, are you able to disable it?

Regardless, we will look into cleaning up these circular dependencies.

@mia-iofinnet
Copy link
Author

As a temporary workaround, are you able to disable it?

Of course, no worries. 😊

@github-actions github-actions bot added the pending-maintainer-response Issue is pending a response from the Amplify team. label Jan 21, 2025
@aaBoustani
Copy link

aaBoustani commented Jan 21, 2025

Hello, I'm not sure if the circular dependencies are causing the problem here, but I have the same issue with trying to sign in with SRP (default auth flow) where I get TypeError: setActiveSignInUsername is not a function (it is undefined).
I ran the same dpdm command from @mia-iofinnet and got these circular dependencies:

10) node_modules/@aws-amplify/auth/dist/cjs/providers/cognito/utils/signInHelpers.js -> node_modules/@aws-amplify/auth/dist/cjs/client/flows/userAuth/handleWebAuthnSignInResult.js
11) node_modules/@aws-amplify/auth/dist/cjs/providers/cognito/utils/signInHelpers.js -> node_modules/@aws-amplify/auth/dist/cjs/client/flows/shared/handlePasswordSRP.js
12) node_modules/@aws-amplify/auth/dist/cjs/providers/cognito/utils/signInHelpers.js -> node_modules/@aws-amplify/auth/dist/cjs/client/flows/userAuth/handleSelectChallengeWithPassword.js
13) node_modules/@aws-amplify/auth/dist/cjs/providers/cognito/utils/signInHelpers.js -> node_modules/@aws-amplify/auth/dist/cjs/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.js
35) node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInHelpers.mjs -> node_modules/@aws-amplify/auth/dist/esm/client/flows/userAuth/handleWebAuthnSignInResult.mjs
36) node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInHelpers.mjs -> node_modules/@aws-amplify/auth/dist/esm/client/flows/shared/handlePasswordSRP.mjs
37) node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInHelpers.mjs -> node_modules/@aws-amplify/auth/dist/esm/client/flows/userAuth/handleSelectChallengeWithPassword.mjs
38) node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInHelpers.mjs -> node_modules/@aws-amplify/auth/dist/esm/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.mjs

I don't have the experimental react component enabled and I've been getting this error on version 6.6.0 as well before updating to 6.12 only for the problem to persist.
The non SRP flows work fine, however.

Let me know if there are more info I should provide. I'd really appreciate your help

@cwomack cwomack added question General question and removed pending-triage Issue is pending triage labels Jan 21, 2025
@cwomack
Copy link
Member

cwomack commented Jan 21, 2025

@aaBoustani, thank you for the additional context here. The circular dependencies originally reported in this issue seemed to be tied to the use of the experimental react compiler in an expo application. We wouldn't consider that a bug on our side, as we can't ensure the use of third party experimental items won't result in unexpected behavior.

But your use case is something we'll investigate further to determine if the root cause of both these issues is a bug or not. Are you saying the TypeError you're getting when using SRP auth flows only began as of v6.6+ but wasn't happening in lower versions? And at any point of upgrading since v6.60, have you cleared our your node_modules and reinstalled dependencies?

@cwomack cwomack added pending-community-response Issue is pending a response from the author or community. and removed pending-maintainer-response Issue is pending a response from the Amplify team. labels Jan 21, 2025
@aaBoustani
Copy link

@cwomack, I did a lot of investigating and I tried different versions to try to pinpoint where the problem is. Always deleting node_modules and yarn.lock and building without cache.

The problem is there when using the latest versions:
Image

I tried using v6.6.0 with aws-aplify/auth v6.8 from an older yarn.lock from the latest version of our app that worked, but was still getting the same error.
Image

Finally, I was able to make it work by installing v6.6.0 without the carat (^) and it was installed with the following deps:
Image

Then I tried to trace the latest version in which it would work, so I first tried v6.10 (The error was still there):
Image

But in v6.9.0, the error is gone and was able to log in:
Image

I hope this was helpful. I included the deps from yarn.lock in case the submodule versions are relevant. Let me know if you need more info or if there's something I should try. Note that I didn't change the code at all, I simply changed the aws-amplify version, then deleted node_modules and yarn.lock before installing again and running expo prebuild --clean, then expo run:ios --no-build-cache for every case.

@github-actions github-actions bot added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-community-response Issue is pending a response from the author or community. labels Jan 22, 2025
@jjarvisp
Copy link
Member

Thanks for the detailed information @aaBoustani.

Can you share the output of the following command?
npx envinfo --system --binaries --browsers --npmPackages --duplicates --npmGlobalPackages

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Jan 22, 2025
@cwomack cwomack added the pending-community-response Issue is pending a response from the author or community. label Jan 22, 2025
@aaBoustani
Copy link

@jjarvisp certainly!

 System:
    OS: macOS 15.2
    CPU: (11) arm64 Apple M3 Pro
    Memory: 141.30 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.17.0/bin/yarn
    npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
  Browsers:
    Safari: 18.2
  npmPackages:
    %name%:  0.1.0 
    @10play/tentap-editor: ^0.5.29 => 0.5.33 
    @amplitude/analytics-react-native: ^1.4.9 => 1.4.11 
    @aws-amplify/backend: ^1.10.0 => 1.13.0 
    @aws-amplify/backend-cli: ^1.4.4 => 1.4.7 
    @aws-amplify/react-native: ^1.1.4 => 1.1.6 
    @aws-amplify/rtn-web-browser: ^1.1.0 => 1.1.1 
    @aws-amplify/ui-react-native: ^2.2.20 => 2.4.1 
    @aws-sdk/client-cognito-identity-provider: ^3.714.0 => 3.732.0 
    @aws-sdk/client-s3: ^3.714.0 => 3.732.0 
    @babel/core: ^7.26.0 => 7.26.0 
    @babel/runtime: ^7.26.0 => 7.26.0 
    @expo-google-fonts/inter: ^0.2.3 => 0.2.3 
    @expo-google-fonts/nunito: ^0.2.3 => 0.2.3 
    @expo/metro-config: ^0.19.8 => 0.19.9 
    @expo/metro-runtime: ~4.0.0 => 4.0.1 
    @expo/vector-icons: ^14.0.2 => 14.0.4 
    @hubspot/api-client: ^12.0.1 => 12.0.1 
    @kingstinct/react-native-healthkit: ^8.2.0 => 8.4.0 
    @langchain/core: ^0.3.24 => 0.3.33 
    @langchain/mistralai: ^0.2.0 => 0.2.0 
    @langchain/openai: ^0.3.13 => 0.3.17 
    @mistralai/mistralai: ^1.3.1 => 1.4.0 
    @parcel/watcher: ^2.4.1 => 2.5.0 
    @react-native-async-storage/async-storage: 1.23.1 => 1.23.1 (1.24.0)
    @react-native-community/checkbox: ^0.5.17 => 0.5.17 
    @react-native-community/cli: ^15.1.3 => 15.1.3 
    @react-native-community/hooks: ^3.0.0 => 3.0.0 
    @react-native-community/netinfo: ^11.3.1 => 11.4.1 
    @react-native-community/slider: 4.5.5 => 4.5.5 
    @react-native-material/core: ^1.3.7 => 1.3.7 
    @react-native-picker/picker: 2.9.0 => 2.9.0 
    @react-native/js-polyfills: ^0.76.5 => 0.76.6 (0.77.0)
    @react-native/metro-babel-transformer: ^0.76.5 => 0.76.6 (0.77.0)
    @react-native/metro-config: ^0.76.5 => 0.76.6 
    @react-navigation/drawer: ^7.1.1 => 7.1.1 
    @react-navigation/native: ^7.0.14 => 7.0.14 
    @shopify/flash-list: 1.7.1 => 1.7.1 
    @shopify/react-native-skia: 1.5.0 => 1.5.0 
    @tanstack/eslint-plugin-query: ^5.51.15 => 5.64.2 
    @tanstack/query-codemods:  undefined ()
    @tanstack/react-query: ^5.62.8 => 5.64.2 
    @types/jest: ^29.5.12 => 29.5.14 
    @types/luxon: ^3.4.2 => 3.4.2 
    @types/react: ~18.3.1 => 18.3.18 (19.0.7)
    @types/react-native-snap-carousel: ^3.8.11 => 3.8.11 
    @types/react-native-svg-charts: ^5.0.16 => 5.0.16 
    @types/react-test-renderer: ^19.0.0 => 19.0.0 
    aws-amplify: 6.9.0 => 6.9.0 
    aws-amplify/adapter-core:  undefined ()
    aws-amplify/analytics:  undefined ()
    aws-amplify/analytics/kinesis:  undefined ()
    aws-amplify/analytics/kinesis-firehose:  undefined ()
    aws-amplify/analytics/personalize:  undefined ()
    aws-amplify/analytics/pinpoint:  undefined ()
    aws-amplify/api:  undefined ()
    aws-amplify/api/server:  undefined ()
    aws-amplify/auth:  undefined ()
    aws-amplify/auth/cognito:  undefined ()
    aws-amplify/auth/cognito/server:  undefined ()
    aws-amplify/auth/enable-oauth-listener:  undefined ()
    aws-amplify/auth/server:  undefined ()
    aws-amplify/data:  undefined ()
    aws-amplify/data/server:  undefined ()
    aws-amplify/datastore:  undefined ()
    aws-amplify/in-app-messaging:  undefined ()
    aws-amplify/in-app-messaging/pinpoint:  undefined ()
    aws-amplify/push-notifications:  undefined ()
    aws-amplify/push-notifications/pinpoint:  undefined ()
    aws-amplify/storage:  undefined ()
    aws-amplify/storage/s3:  undefined ()
    aws-amplify/storage/s3/server:  undefined ()
    aws-amplify/storage/server:  undefined ()
    aws-amplify/utils:  undefined ()
    aws-appsync-auth-link: ^3.0.7 => 3.0.7 
    aws-appsync-subscription-link: ^3.1.3 => 3.1.3 
    aws-cdk: ^2.173.2 => 2.176.0 
    aws-cdk-lib: ^2.173.2 => 2.176.0 
    axios: ^1.7.9 => 1.7.9 
    chat:  1.0.0 
    constructs: ^10.3.0 => 10.4.2 
    dotenv: ^16.4.5 => 16.4.7 
    esbuild: ^0.24.0 => 0.24.2 (0.23.1)
    eslint: ^9.17.0 => 9.18.0 
    eslint-config-expo: ^8.0.1 => 8.0.1 
    expo: ~52.0.19 => 52.0.27 
    expo-auth-session: ~6.0.1 => 6.0.2 
    expo-blur: ~14.0.1 => 14.0.2 
    expo-camera: ~16.0.10 => 16.0.13 
    expo-checkbox: ~4.0.0 => 4.0.1 
    expo-constants: ~17.0.3 => 17.0.4 
    expo-dev-client: ~5.0.6 => 5.0.10 
    expo-document-picker: ~13.0.1 => 13.0.2 
    expo-font: ~13.0.1 => 13.0.3 
    expo-image: ^2.0.3 => 2.0.4 
    expo-image-manipulator: ~13.0.6 => 13.0.6 
    expo-image-picker: ~16.0.3 => 16.0.4 
    expo-linear-gradient: ~14.0.1 => 14.0.2 
    expo-linking: ~7.0.3 => 7.0.4 
    expo-media-library: ~17.0.4 => 17.0.5 
    expo-notifications: ~0.29.11 => 0.29.12 
    expo-router: ~4.0.13 => 4.0.17 
    expo-secure-store: ~14.0.0 => 14.0.1 
    expo-splash-screen: ~0.29.18 => 0.29.21 
    expo-status-bar: ~2.0.0 => 2.0.1 
    expo-system-ui: ~4.0.6 => 4.0.7 
    expo-web-browser: ~14.0.1 => 14.0.2 
    i18next: ^24.1.2 => 24.2.1 
    intl-pluralrules: ^2.0.1 => 2.0.1 
    jest: ^29.2.1 => 29.7.0 
    jest-expo: ~52.0.2 => 52.0.3 
    langchain: ^0.3.5 => 0.3.12 
    luxon: ^3.5.0 => 3.5.0 
    metro-config: ^0.81.0 => 0.81.0 
    metro-runtime: ^0.81.0 => 0.81.0 
    nativewind: ^2.0.11 => 2.0.11 
    prettier: ^3.3.3 => 3.4.2 (2.3.2, 2.8.8, 1.19.1)
    prettier-plugin-organize-imports: ^4.0.0 => 4.1.0 
    pretty-quick: ^4.0.0 => 4.0.0 
    react: 18.3.1 => 18.3.1 
    react-dom: 18.3.1 => 18.3.1 
    react-i18next: ^15.0.1 => 15.4.0 
    react-native: 0.76.6 => 0.76.6 (0.77.0)
    react-native-chart-kit: ^6.12.0 => 6.12.0 
    react-native-compressor: ^1.10.3 => 1.10.3 
    react-native-date-picker: ^5.0.7 => 5.0.8 
    react-native-element-dropdown: ^2.12.4 => 2.12.4 
    react-native-gesture-handler: ~2.20.2 => 2.20.2 
    react-native-get-random-values: ^1.11.0 => 1.11.0 
    react-native-gifted-charts: ^1.4.47 => 1.4.55 
    react-native-linear-gradient: ^2.8.3 => 2.8.3 
    react-native-notifier: ^2.0.0 => 2.0.0 
    react-native-paper: ^5.12.3 => 5.13.1 
    react-native-picker-horizontal: ^0.1.2 => 0.1.2 
    react-native-reanimated: ~3.16.5 => 3.16.7 
    react-native-reanimated-carousel: 4.0.0-canary.22 => 4.0.0-canary.22 
    react-native-safe-area-context: 4.12.0 => 4.12.0 
    react-native-screens: ~4.4.0 => 4.4.0 
    react-native-shimmer-placeholder: ^2.0.9 => 2.0.9 
    react-native-svg: 15.8.0 => 15.8.0 (6.5.3)
    react-native-svg-transformer: ^1.5.0 => 1.5.0 
    react-native-url-polyfill: ^2.0.0 => 2.0.0 
    react-native-web: ~0.19.10 => 0.19.13 
    react-native-webview: 13.12.5 => 13.12.5 
    react-test-renderer: 19.0.0 => 19.0.0 (18.3.1)
    reanimated-color-picker: ^3.0.6 => 3.0.6 
    tailwindcss: 3.3.2 => 3.3.2 
    ts-jest: ^29.2.5 => 29.2.5 
    tsx: ^4.19.0 => 4.19.2 
    typescript: ^5.5.4 => 5.7.3 (4.4.4, 4.9.5)
    uuid: ^11.0.3 => 11.0.5 (9.0.1, 8.3.2, 10.0.0, 7.0.3)
    version: ^0.1.2 => 0.1.2 
    victory-native: ^41.14.0 => 41.16.0 
    web-streams-polyfill: ^3.3.3 => 3.3.3 (, 4.0.0-beta.3)
    web-streams-polyfill-es2018:  undefined ()
    web-streams-polyfill-es6:  undefined ()
    web-streams-ponyfill:  undefined ()
    web-streams-ponyfill-es2018:  undefined ()
    web-streams-ponyfill-es6:  undefined ()
    zod: ^3.23.8 => 3.24.1 (3.23.8)
    zod-to-json-schema: ^3.23.1 => 3.24.1 
    zustand: ^5.0.2 => 5.0.3 
  npmGlobalPackages:
    cognito-backup: 4.1.0
    corepack: 0.29.3
    eas-cli: 12.4.1
    npm: 10.8.2
    react-devtools: 6.0.1
    ts-node: 10.9.2
    yarn: 1.22.22

@github-actions github-actions bot added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-community-response Issue is pending a response from the author or community. labels Jan 23, 2025
@jjarvisp
Copy link
Member

Thanks for sharing @aaBoustani. Nothing is jumping out at me in that output and I'm still unable to reproduce on my end. I'll keep trying but would you mind sharing some of your build configuration files i.e. babel config, app.json, etc.? Please redact anything sensitive if necessary.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Jan 24, 2025
@aaBoustani
Copy link

@jjarvisp sorry for the delay, here are the config files:

app.json

{
  "expo": {
    "name": "appname",
    "slug": "appname",
    "scheme": "appname",
    "version": "0.2.0",
    "privacy": "public",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "userInterfaceStyle": "automatic",
    "newArchEnabled": true,
    "ios": {
      "buildNumber": "8",
      "supportsTablet": true,
      "bundleIdentifier": "com.companyname.appname",
      "infoPlist": {
        "NSCameraUsageDescription": "Allow access to your Camera",
        "NSPhotoLibraryAddUsageDescription": "Allow access to your Photo Library",
        "NSPhotoLibraryUsageDescription": "Allow access to your Photo Library",
        "NSHealthShareUsageDescription": "Allow access to your Health Data",
        "NSUserActivityTypes": [
          "$(PRODUCT_BUNDLE_IDENTIFIER).expo.index_route"
        ],
        "NSHealthUpdateUsageDescription": "Allow Appname to access your Health Data"
      },
      "entitlements": {
        "com.apple.developer.healthkit": true,
        "com.apple.developer.healthkit.background-delivery": true
      }
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "package": "com.companyname.appname",
      "intentFilters": [
        {
          "action": "VIEW",
          "data": [
            {
              "scheme": "appname"
            }
          ],
          "category": [
            "BROWSABLE",
            "DEFAULT"
          ]
        }
      ]
    },
    "web": {
      "favicon": "./assets/favicon.png",
      "bundler": "metro"
    },
    "plugins": [
      [
        "expo-splash-screen",
        {
          "backgroundColor": "#232323",
          "image": "./assets/icon.png",
          "dark": {
            "image": "./assets/icon.png",
            "backgroundColor": "#000000"
          },
          "imageWidth": 200
        }
      ],
      "expo-router",
      [
        "expo-image-picker",
        {
          "photosPermission": "Allow Appname to access your photos",
          "cameraPermission": "Allow Appname to access your camera"
        }
      ],
      [
        "@kingstinct/react-native-healthkit",
        {
          "NSHealthShareUsageDescription": "Allow Appname to access your Health Data",
          "NSHealthUpdateUsageDescription": false,
          "background": false
        }
      ],
      "expo-font",
      "expo-secure-store",
      "react-native-compressor"
    ],
    "extra": {
      "eas": {
        "projectId": "eas-project-id"
      }
    }
  }
}

tsconfig.json

{
  "extends": "expo/tsconfig.base",
  "compilerOptions": {
    "strict": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./*"],
      "$amplify/*": ["./.amplify/generated/*"]
    },
    "jsx": "react-native"
  },
  "include": [
    "**/*.ts",
    "**/*.tsx",
    "app/(app)/inside/(tabs)/recipes.js"
  ]
}

metro.config.js

const { getDefaultConfig } = require('expo/metro-config');

const config = getDefaultConfig(__dirname);

config.resolver.assetExts = config.resolver.assetExts.filter((ext) => ext !== 'svg');
config.resolver.sourceExts = [...config.resolver.sourceExts, 'svg'];
config.resolver.extraNodeModules = {
  ...config.resolver.extraNodeModules,
  'web-streams-polyfill': require.resolve('web-streams-polyfill'),
};
config.transformer.babelTransformerPath = require.resolve('react-native-svg-transformer');
config.transformer = {
  ...config.transformer,
  getTransformOptions: async () => ({
    transform: {
      experimentalImportSupport: true,
      inlineRequires: false,
    },
  }),
};
config.resolver.sourceExts = [...config.resolver.sourceExts, 'js', 'json', 'ts', 'tsx', 'jsx', 'es6'];

module.exports = config;

babel.config.js

module.exports = api => {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: ['nativewind/babel', 'react-native-reanimated/plugin'],
  };
};

eas.json

{
  "cli": {
    "version": ">= 3.6.0"
  },
  "build": {
    "development": {
      "distribution": "internal",
      "android": {
        "gradleCommand": ":app:assembleDebug"
      },
      "ios": {
        "buildConfiguration": "Debug",
        "resourceClass": "m1-medium"
      }
    },
    "preview": {
      "distribution": "internal",
      "ios": {
        "resourceClass": "m1-medium"
      }
    },
    "production": {
      "ios": {
        "resourceClass": "m1-medium"
      }
    }
  },
  "submit": {
    "production": {}
  }
}

I think this is all, if there's a missing config, please let me know.

@github-actions github-actions bot added the pending-maintainer-response Issue is pending a response from the Amplify team. label Jan 28, 2025
@jjarvisp
Copy link
Member

Hi @aaBoustani, thanks for the detailed config info. In this case, it looks like the issue is caused by enabling experimental import support in the metro bundler. Are you able to disable this as a temporary workaround?

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Jan 28, 2025
@cwomack cwomack added the pending-community-response Issue is pending a response from the author or community. label Jan 29, 2025
@aaBoustani
Copy link

@jjarvisp disabling the feature works! Thank you very much!
Although the import support would be pretty nice, I don't mind sacrificing it in favor of using the latest aws package.

@github-actions github-actions bot added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-community-response Issue is pending a response from the author or community. labels Jan 30, 2025
@jjarvisp
Copy link
Member

Thanks for verifying @aaBoustani! We're working on a fix for this and will update here when we have more information.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Jan 31, 2025
@cshfang
Copy link
Member

cshfang commented Feb 4, 2025

@mia-iofinnet @aaBoustani

[email protected] has been released and should include a fix for eliminating the Auth circular dependencies mentioned above from the library.

Please let us know if this helps to mitigate the issues you have been experiencing, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Related to core Amplify issues dependencies Pull requests that update a dependency file question General question
Projects
None yet
Development

No branches or pull requests

5 participants