aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.43k stars 2.12k forks source link

Error in Release Build in Auth.SignIn ([TypeError: (0,l.default) is not a function. (In '(0,l.default)(t.byteLength)', '(0,l.default)' is undefined)]) #9505

Closed nickrobinson352 closed 1 year ago

nickrobinson352 commented 2 years ago

Before opening, please confirm:

JavaScript Framework

React Native

Amplify APIs

Authentication

Amplify Categories

auth

Environment information

``` # Put output below this line System: OS: macOS 12.0.1 CPU: (10) x64 Apple M1 Pro Memory: 90.82 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 14.18.2 - ~/.nvm/versions/node/v14.18.2/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.15 - ~/.nvm/versions/node/v14.18.2/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Browsers: Chrome: 97.0.4692.99 Firefox Developer Edition: 96.0 Safari: 15.1 npmPackages: @aws-amplify/pushnotification: ^4.3.9 => 4.3.9 @babel/cli: ^7.12.10 => 7.16.8 @babel/core: ^7.6.2 => 7.16.12 @babel/preset-env: ^7.0.0 => 7.16.11 @babel/preset-flow: ^7.12.13 => 7.16.7 @babel/runtime: ^7.6.2 => 7.16.7 @bugsnag/plugin-react-native-navigation: ^7.6.0 => 7.15.1 @bugsnag/react-native: ^7.6.1 => 7.15.1 @freakycoder/react-native-helpers: ^0.1.3 => 0.1.3 @react-native-async-storage/async-storage: ^1.15.16 => 1.15.16 @react-native-community/async-storage: ^1.12.1 => 1.12.1 @react-native-community/blur: 3.4.1 => 3.4.1 @react-native-community/cameraroll: ^1.5.2 => 1.8.1 @react-native-community/datetimepicker: ^3.0.9 => 3.5.2 @react-native-community/netinfo: ^5.5.0 => 5.9.10 @react-native-community/push-notification-ios: ^1.4.0 => 1.10.1 (1.0.3) @react-native-firebase/analytics: ^14.2.3 => 14.2.3 @react-native-firebase/app: ^14.2.3 => 14.2.3 @react-native-firebase/auth: ^14.2.3 => 14.2.3 @react-native-firebase/crashlytics: ^14.2.3 => 14.2.3 @react-native-firebase/database: ^14.2.3 => 14.2.3 @react-native-firebase/perf: ^14.2.3 => 14.2.3 @react-native-google-signin/google-signin: ^7.0.4 => 7.0.4 @tradle/react-native-http: ^2.0.1 => 2.0.1 @welldone-software/why-did-you-render: ^4.2.1 => 4.3.2 @wwimmo/react-native-sketch-canvas: git+https://github.com/wwimmo/react-native-sketch-image.git => 0.8.3 Basic: 0.0.1 Example: 0.0.1 HelloWorld: 0.0.1 PDFExample: 0.0.1 SignatureCaptureExample: 0.0.1 amazon-cognito-identity-js: ^3.0.6 => 3.3.3 (5.2.4) assert: ^1.4.1 => 1.5.0 aws-amplify: ^4.3.12 => 4.3.12 aws-amplify-react: ^5.1.9 => 5.1.9 aws-amplify-react-native: ^6.0.2 => 6.0.2 aws-sdk: ^2.1062.0 => 2.1062.0 axios: ^0.24.0 => 0.24.0 (0.21.4) babel-jest: ^26.6.3 => 26.6.3 babel-plugin-transform-remove-console: ^6.9.4 => 6.9.4 browserify-zlib: ^0.1.4 => 0.1.4 buffer: ^5.6.0 => 5.7.1 (4.9.2, 4.9.1) bugsnag-react-native: ^2.23.10 => 2.23.10 console-browserify: ^1.1.0 => 1.2.0 constants-browserify: ^1.0.0 => 1.0.0 deprecated-react-native-listview: 0.0.7 => 0.0.7 detox: ^17.11.4 => 17.14.9 dns.js: ^1.0.1 => 1.0.1 domain-browser: ^1.2.0 => 1.2.0 example: 0.0.1 exampleapp: 0.0.1 hermes-inspector-msggen: 1.0.0 http-server: ^0.11.1 => 0.11.2 https-browserify: 0.0.1 => 0.0.1 immutability-helper: ^2.7.1 => 2.9.1 imokhles-react-native-app-tour: ^2.0.8 => 2.0.8 jest: ^26.6.3 => 26.6.3 jetifier: ^1.6.5 => 1.6.8 lodash: ^4.17.15 => 4.17.21 mdurl: ^1.0.1 => 1.0.1 metro-react-native-babel-preset: ^0.66.2 => 0.66.2 moment: ^2.24.0 => 2.29.1 native-base: ^2.13.8 => 2.15.2 path-browserify: 0.0.0 => 0.0.0 process: ^0.11.10 => 0.11.10 querystring-es3: ^0.2.1 => 0.2.1 react: 17.0.2 => 17.0.2 react-addons-shallow-compare: ^15.6.0 => 15.6.3 (15.6.2) react-native: ^0.66.4 => 0.66.4 react-native-action-button: git+https://github.com/nickrobinson352/react-native-action-button.git => 2.8.3 react-native-actionsheet: ^2.4.2 => 2.4.2 react-native-animatable: ^1.3.2 => 1.3.3 react-native-appearance: 0.3.3 => 0.3.3 react-native-autoheight-webview: ^1.5.1 => 1.6.1 react-native-aws3: ^0.0.9 => 0.0.9 react-native-calendar-events: ^2.1.0 => 2.2.0 react-native-calendars: ^1.263.0 => 1.1276.0 react-native-checkbox: 2.0.0 => 2.0.0 react-native-code-push: ^6.1.1 => 6.4.1 react-native-confirmation-code-input: ^1.0.4 => 1.0.4 react-native-copilot: ^2.5.1 => 2.5.1 react-native-create-thumbnail: ^1.2.2 => 1.5.1 react-native-device-info: ^5.6.3 => 5.6.5 react-native-dialog-input: ^1.0.4 => 1.0.8 react-native-document-picker: ^3.5.4 => 3.5.4 react-native-dropdownalert: ^3.4.0 => 3.11.0 react-native-elements: ^1.1.0 => 1.2.7 react-native-file-viewer: ^2.0.2 => 2.1.5 react-native-fs: ^2.16.6 => 2.18.0 react-native-gallery-swiper: ^1.26.4 => 1.26.4 react-native-gifted-chat: ^0.16.1 => 0.16.3 react-native-global-props: ^1.1.5 => 1.1.5 react-native-google-drive-api-wrapper: ^1.4.0 => 1.4.0 react-native-gradient-header: ^0.2.1 => 0.2.1 react-native-html-to-pdf: ^0.8.0 => 0.8.0 react-native-hyperlink: 0.0.19 => 0.0.19 react-native-image-crop-picker: 0.28.0 => 0.28.0 react-native-image-placeholder: ^1.0.14 => 1.0.14 react-native-image-progress: ^1.1.1 => 1.2.0 react-native-image-resizer: ^1.0.0 => 1.4.5 react-native-img-cache: ^1.6.0 => 1.6.0 react-native-iphone-x-helper: ^1.2.0 => 1.3.1 react-native-keyboard-aware-scroll-view: ^0.9.5 => 0.9.5 react-native-keyboard-spacer: ^0.4.1 => 0.4.1 react-native-level-fs: ^3.0.1 => 3.0.1 react-native-linear-gradient: ^2.5.6 => 2.5.6 react-native-loading-spinner-overlay: 1.1.0 => 1.1.0 react-native-material-dropdown: git+https://github.com/nickrobinson352/react-native-material-dropdown.git => 0.11.1 react-native-modal: ^2.5.0 => 2.5.0 react-native-modal-datetime-picker: ^9.1.0 => 9.2.3 react-native-modal-dropdown: ^0.5.0 => 0.5.0 react-native-multiple-select: ^0.5.5 => 0.5.7 react-native-navigation: ^6.12.2 => 6.12.2 react-native-navigation-hooks: ^6.1.0 => 6.3.0 react-native-os: 1.2.6 => 1.2.6 react-native-pdf: ^5.0.9 => 5.1.7 react-native-permissions: ^1.1.1 => 1.2.1 react-native-picker: ^4.3.7 => 4.3.7 react-native-popup-dialog: ^0.17.0 => 0.17.3 react-native-progress: ^4.1.2 => 4.1.2 react-native-quick-actions: ^0.3.13 => 0.3.13 react-native-scrollable-tab-view: git+https://github.com/Tiepbm/react-native-scrollable-tab-view.git => 1.0.0 react-native-sectioned-multi-select: ^0.7.6 => 0.7.7 react-native-sha256: ^1.1.1 => 1.4.7 react-native-share: 3.0.0 => 3.0.0 react-native-signature-capture: ^0.4.10 => 0.4.12 react-native-sketch-canvas: https://github.com/wwimmo/react-native-sketch-image => 0.8.3 react-native-slowlog: ^1.0.2 => 1.0.2 react-native-snap-carousel: ^3.9.1 => 3.9.1 react-native-svg: ^11.0.1 => 11.0.1 react-native-svg-charts: 5.3.0 => 5.3.0 react-native-swipe-list-view: ^2.5.0 => 2.5.0 react-native-switch-selector: ^1.1.8 => 1.1.14 react-native-timer: ^1.3.3 => 1.3.6 react-native-uuid: ^1.4.9 => 1.4.9 react-native-vector-icons: ^9.0.0 => 9.0.0 (7.1.0) react-native-version-check: ^3.4.1 => 3.4.2 react-native-version-number: ^0.3.2 => 0.3.6 react-native-video: ^4.4.5 => 4.4.5 react-native-video-player: ^0.10.1 => 0.10.1 react-native-webview: ^9.1.4 => 9.4.0 react-native-youtube: ^2.0.0 => 2.0.2 react-redux: ^5.0.7 => 5.1.2 react-test-renderer: 17.0.2 => 17.0.2 readable-stream: ^1.0.33 => 1.1.14 (3.6.0, 1.0.34, 2.3.7) redux: ^3.7.2 => 3.7.2 redux-devtools-extension: ^2.13.8 => 2.13.9 redux-logger: ^3.0.6 => 3.0.6 redux-persist: ^4.8.3 => 4.10.2 redux-persist-transform-filter: 0.0.15 => 0.0.15 redux-persist/constants: undefined () redux-persist/storages: undefined () redux-promise-middleware: ^4.4.2 => 4.4.2 redux-saga: ^0.15.6 => 0.15.6 redux-saga/effects: undefined () redux-saga/utils: undefined () redux-thunk: ^2.3.0 => 2.4.1 remote-redux-devtools: ^0.5.16 => 0.5.16 remotedev-rn-debugger: ^0.8.4 => 0.8.4 rn-fetch-blob: ^0.12.0 => 0.12.0 rn-nodeify: github:tradle/rn-nodeify => 10.3.0 squirrelly: ^8.0.3 => 8.0.8 src: undefined () stream-browserify: ^1.0.0 => 1.0.0 timers-browserify: ^1.4.2 => 1.4.2 tty-browserify: 0.0.0 => 0.0.0 url: ^0.10.3 => 0.10.3 (0.11.0) util: ^0.10.4 => 0.10.4 (0.10.3) uuid: ^3.3.2 => 3.4.0 (3.3.2, 8.3.2, 3.1.0, 3.2.1, 7.0.3) vm-browserify: 0.0.4 => 0.0.4 npmGlobalPackages: @aws-amplify/cli: 7.6.11 create-react-native-app: 3.7.2 detox-cli: 17.11.0 javascript-obfuscator: 3.0.0 jshint: 2.12.0 react-native-cli: 2.0.1 uglify-js: 3.14.5 ```

Describe the bug

I get the following error when running in IOS Release

[TypeError: (0,l.default) is not a function. (In '(0,l.default)(t.byteLength)', '(0,l.default)' is undefined)]

This works perfectly fine in DEBUG !

Expected behavior

The application works perfectly well in DEBUG but when I run this in Release, I get the following exception in the Auth.SignIn Function

Reproduction steps

Code Snippet

// Put your code below this line.
try {
        console.log('login')
        const user = await Auth.signIn(username, password);
    } catch (error) {

        console.log( error);
    }

Log output

``` // Put your logs below this line [TypeError: (0,l.default) is not a function. (In '(0,l.default)(t.byteLength)', '(0,l.default)' is undefined)] ```

aws-exports.js

const awsmobile = {
    Auth: {
        // REQUIRED - Amazon Cognito Identity Pool ID
        identityPoolId: 'us-east-1:XXXXX',
        // REQUIRED - Amazon Cognito Region
        region: 'us-east-1',
        // OPTIONAL - Amazon Cognito User Pool ID
        userPoolId: 'us-east-1XXXXX,
        // OPTIONAL - Amazon Cognito Web Client ID (26-char alphanumeric string)
        userPoolWebClientId: 'XXXXX',
    },
    API: {
        endpoints: [
            {
                name: "App",
                endpoint: "https://XXX.execute-api.us-east-1.amazonaws.com/prod"
            }
        ]
    }
}

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

nadetastic commented 1 year ago

Hi @nickrobinson352 👋,

This error can happen if an import is set incorrectly. Can you confirm how you have your Auth import defined?

nadetastic commented 1 year ago

Hi @nickrobinson352 - I'll close out this issue for now, however please let me know if you are still facing this issue or have any questions on it.