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.42k stars 2.12k forks source link

Type 'Timeout' is not assignable to type 'number'. #12640

Closed pau1foster closed 9 months ago

pau1foster commented 9 months ago

Before opening, please confirm:

JavaScript Framework

Angular

Amplify APIs

Authentication

Amplify Categories

auth

Environment information

``` # Put output below this line System: OS: macOS 13.5.2 CPU: (10) arm64 Apple M1 Pro Memory: 175.31 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 21.2.0 - /opt/homebrew/bin/node npm: 10.2.3 - /opt/homebrew/bin/npm Browsers: Chrome: 119.0.6045.159 Edge: 119.0.2151.72 Safari: 16.6 npmPackages: @angular-devkit/build-angular: 16.2.10 => 16.2.10 @angular-devkit/build-webpack: 0.1700.1 => 0.1700.1 (0.1602.10) @angular-eslint/builder: 16.3.1 => 16.3.1 @angular-eslint/eslint-plugin: 16.3.1 => 16.3.1 @angular-eslint/eslint-plugin-template: 16.3.1 => 16.3.1 @angular-eslint/schematics: 16.3.1 => 16.3.1 @angular-eslint/template-parser: 16.3.1 => 16.3.1 @angular/animations: 16.2.12 => 16.2.12 @angular/cli: 16.2.10 => 16.2.10 @angular/common: 16.2.12 => 16.2.12 @angular/compiler: 16.2.12 => 16.2.12 @angular/compiler-cli: 16.2.12 => 16.2.12 @angular/core: 16.2.12 => 16.2.12 @angular/forms: 16.2.12 => 16.2.12 @angular/localize: 16.2.12 => 16.2.12 @angular/platform-browser: 16.2.12 => 16.2.12 @angular/platform-browser-dynamic: 16.2.12 => 16.2.12 @angular/router: 16.2.12 => 16.2.12 @aws-amplify/ui-angular: 5.0.2 => 5.0.2 @cypress/angular: 0.0.0-development @cypress/mount-utils: 0.0.0-development @cypress/react: 0.0.0-development @cypress/react18: 0.0.0-development @cypress/svelte: 0.0.0-development @cypress/vue: 0.0.0-development @cypress/vue2: 0.0.0-development @fortawesome/angular-fontawesome: 0.13.0 => 0.13.0 @fortawesome/fontawesome-free: 6.4.2 => 6.4.2 @fortawesome/fontawesome-svg-core: 6.4.2 => 6.4.2 @fortawesome/free-solid-svg-icons: 6.4.2 => 6.4.2 @ng-bootstrap/ng-bootstrap: 15.1.2 => 15.1.2 @ngrx/effects: 16.3.0 => 16.3.0 @ngrx/store: 16.3.0 => 16.3.0 @ngtools/webpack: 16.2.10 => 16.2.10 @pact-foundation/karma-pact: 3.1.0 => 3.1.0 @pact-foundation/pact-node: 10.17.7 => 10.17.7 @pact-foundation/pact-web: 9.17.3 => 9.17.3 @popperjs/core: 2.11.8 => 2.11.8 @simonsmith/cypress-image-snapshot: 9.0.1 => 9.0.1 @types/datatables.net: 1.10.28 => 1.10.28 @types/datatables.net-buttons: 1.4.10 => 1.4.10 @types/jasmine: 5.1.4 => 5.1.4 @types/jasminewd2: 2.0.13 => 2.0.13 @types/jquery: 3.5.29 => 3.5.29 @types/node: 20.10.0 => 20.10.0 (18.18.12) @typescript-eslint/eslint-plugin: 6.13.0 => 6.13.0 @typescript-eslint/parser: 6.13.0 => 6.13.0 angular-datatables: 16.0.1 => 16.0.1 angular-http-server: 1.12.0 => 1.12.0 aws-amplify: 6.0.5 => 6.0.5 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/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 () babel-loader: 9.1.3 => 9.1.3 bootstrap: 5.3.2 => 5.3.2 bsd-3-module: 0.0.0 copy-webpack-plugin: 11.0.0 => 11.0.0 css-loader: 6.8.1 => 6.8.1 css-minimizer-webpack-plugin: 5.0.1 => 5.0.1 cssnano: 6.0.1 => 6.0.1 custom-license: 0.0.0 cypress: 13.6.0 => 13.6.0 datatables.net: 1.13.8 => 1.13.8 (1.13.7) datatables.net-bs5: 1.13.8 => 1.13.8 datatables.net-buttons: 2.4.2 => 2.4.2 datatables.net-buttons-dt: 2.4.2 => 2.4.2 datetime-moment: 1.0.0 => 1.0.0 dayjs: 1.11.10 => 1.11.10 eslint: 8.54.0 => 8.54.0 invalid-with-comma: 0.0.0 jasmine-core: 5.1.1 => 5.1.1 (4.6.0) jasmine-spec-reporter: 7.0.0 => 7.0.0 jquery: 3.7.1 => 3.7.1 karma: 6.4.2 => 6.4.2 karma-chrome-launcher: 3.2.0 => 3.2.0 karma-coverage: 2.2.1 => 2.2.1 karma-coverage-coffee-example: 1.0.0 karma-jasmine: 5.1.0 => 5.1.0 karma-jasmine-html-reporter: 2.1.0 => 2.1.0 karma-junit-reporter: 2.0.1 => 2.0.1 karma-sonarqube-unit-reporter: 0.0.23 => 0.0.23 keyboardevent-key-polyfill: 1.1.0 => 1.1.0 less: 4.2.0 => 4.2.0 (4.1.3) less-loader: 11.1.3 => 11.1.3 (11.1.0) license-checker: 25.0.1 => 25.0.1 mini-css-extract-plugin: 2.7.6 => 2.7.6 moment: 2.29.4 => 2.29.4 moment-timezone: 0.5.43 => 0.5.43 ng-openapi-gen: 0.51.0 => 0.51.0 ngx-drag-drop: 16.1.0 => 16.1.0 ngx-moment: 6.0.2 => 6.0.2 node-example: 1.0.0 postcss: 8.4.31 => 8.4.31 postcss-import: 15.1.0 => 15.1.0 postcss-loader: 7.3.3 => 7.3.3 postcss-modules-extract-imports: 3.0.0 => 3.0.0 postcss-modules-local-by-default: 4.0.3 => 4.0.3 postcss-modules-scope: 3.0.0 => 3.0.0 postcss-modules-values: 4.0.0 => 4.0.0 private: 0.0.0 protractor-example: 1.0.0 public-domain-module: 0.0.0 raw-loader: 4.0.2 => 4.0.2 rxjs: 7.8.1 => 7.8.1 rxjs/ajax: undefined () rxjs/fetch: undefined () rxjs/operators: undefined () rxjs/testing: undefined () rxjs/webSocket: undefined () sass-loader: 13.3.2 => 13.3.2 sonar-scanner: 3.1.0 => 3.1.0 source-map-loader: 4.0.1 => 4.0.1 stylus-loader: 7.1.3 => 7.1.3 terser-webpack-plugin: 5.3.9 => 5.3.9 ts-node: 10.9.1 => 10.9.1 tslib: 2.6.2 => 2.6.2 (2.6.1, 1.14.1) typescript: 5.1.6 => 5.1.6 (5.0.4) typescript-example: 1.0.0 uuid: 9.0.1 => 9.0.1 (8.3.2) webpack: 5.89.0 => 5.89.0 (5.88.2) webpack-dev-middleware: 6.1.1 => 6.1.1 (5.3.3) webpack-dev-server: 4.15.1 => 4.15.1 zone.js: 0.13.3 => 0.13.3 npmGlobalPackages: @angular/cli: 16.2.2 npm: 10.2.3 ```

Describe the bug

When doing an ng build the following error is shown:

Error: node_modules/@aws-amplify/core/src/clients/middleware/retry/middleware.ts:116:3 - error TS2322: Type 'Timeout' is not assignable to type 'number'.

116 timeoutId = setTimeout(resolve, timeoutMs);



### Expected behavior

It builds - correctly, without an error.

### Reproduction steps

npm install
ng build

### Code Snippet

```javascript
// Put your code below this line.

```

### Log output

<details>

```
// Put your logs below this line

```

</details>

### 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_
erinleigh90 commented 9 months ago

@pau1foster Thank you for bringing this to our attention! We are working on a fix now and you should be able to test in unstable today or tomorrow.

pau1foster commented 9 months ago

this is now fixed & working fine in: 6.0.6-unstable.8ca7c15.0 (subsequent commit). thanks @erinleigh90.

erinleigh90 commented 9 months ago

@pau1foster The changes were released to unstable yesterday evening. Can you please test with aws-amplify@unstable and verify that your project is building correctly?

pau1foster commented 9 months ago

@erinleigh90 npm install aws-amplify@unstable pulls in what i'd mentioned above, "aws-amplify": "6.0.6-unstable.8ca7c15.0".

pau1foster commented 9 months ago

i'm not sure why but it didn't create a specific one for this commit, pipeline issue? latest on the unstable branch is fine.

hanna-becker commented 9 months ago

I also faced this issue and in my case the problem was that my IDE uses auto-completion for imports and imported some stuff from deep paths within the amplify package. Changing those to as flat as possible paths made the error go away.

cwomack commented 9 months ago

The fix for this was released today in Amplify v6.0.6. I'll close this issue for now, but let us know if there are any further issues related to this bug!