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

Angular v17 and latest typescript having issues with @aws-amplify sub-dependencies #13260

Open
3 tasks done
simonramosb opened this issue Apr 17, 2024 · 2 comments
Open
3 tasks done
Assignees
Labels
Angular Related to Angular 2+ dependencies Pull requests that update a dependency file pending-triage Issue is pending triage

Comments

@simonramosb
Copy link

Before opening, please confirm:

JavaScript Framework

Angular

Amplify APIs

GraphQL API

Amplify Version

v6

Amplify Categories

api

Backend

Other

Environment information

# Put output below this line
Angular v17.3.4
node 18 lts
typescript: 5.4.5
aws-amplify: 6.0.28

Describe the bug

I'm migrating an app made with ionic and angular, to newer versions (v17, where i need typescript >= 5.2.0). Everything seems fine, until i built.

I had lots of these errors, with the @aws-amply/plugin-types package. (Detailed in log output section)

Error: node_modules/@aws-amplify/plugin-types/lib/function_resources.d.ts:1:40 - error TS2307: Cannot find module 'aws-cdk-lib/aws-lambda' or its corresponding type declarations

I found out that is a dependency of @aws-amplify/data-schema-types
yarn.lock screenshot:
image

If i rollback to typescript 4.9.5 everything works fine, but its not compatible with angular v17.

Thanks in advance for reading my issue, any ideas or possible hacks will be highly appreciated :)

Expected behavior

Correct build

Reproduction steps

  1. yarn install
  2. ionic serve // ng serve // ng build

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line
[ng] Error: node_modules/@aws-amplify/plugin-types/lib/auth_resources.d.ts:1:23 - error TS2307: Cannot find module 'aws-cdk-lib/aws-iam' or its corresponding type declarations.
[ng] 
[ng] 1 import { IRole } from 'aws-cdk-lib/aws-iam';
[ng]                         ~~~~~~~~~~~~~~~~~~~~~
[ng] 
[ng] 
[ng] Error: node_modules/@aws-amplify/plugin-types/lib/auth_resources.d.ts:2:142 - error TS2307: Cannot find module 'aws-cdk-lib/aws-cognito' or its corresponding type declarations.
[ng] 
[ng] 2 import { CfnIdentityPool, CfnIdentityPoolRoleAttachment, CfnUserPool, CfnUserPoolClient, CfnUserPoolGroup, IUserPool, IUserPoolClient } from 'aws-cdk-lib/aws-cognito';
[ng]                                                                                                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~
[ng] 
[ng] 
[ng] Error: node_modules/@aws-amplify/plugin-types/lib/backend_secret_resolver.d.ts:1:27 - error TS2307: Cannot find module 'constructs' or its corresponding type declarations.
[ng] 
[ng] 1 import { Construct } from 'constructs';
[ng]                             ~~~~~~~~~~~~
[ng] 
[ng] 
[ng] Error: node_modules/@aws-amplify/plugin-types/lib/backend_secret_resolver.d.ts:3:29 - error TS2307: Cannot find module 'aws-cdk-lib' or its corresponding type declarations.
[ng] 
[ng] 3 import { SecretValue } from 'aws-cdk-lib';
[ng]                               ~~~~~~~~~~~~~
[ng] 
[ng] 
[ng] Error: node_modules/@aws-amplify/plugin-types/lib/backend_stack_creator.d.ts:1:23 - error TS2307: Cannot find module 'aws-cdk-lib' or its corresponding type declarations.
[ng] 
[ng] 1 import { Stack } from 'aws-cdk-lib';
[ng]                         ~~~~~~~~~~~~~
[ng] 
[ng] 
[ng] Error: node_modules/@aws-amplify/plugin-types/lib/construct_container.d.ts:1:27 - error TS2307: Cannot find module 'constructs' or its corresponding type declarations.
[ng] 
[ng] 1 import { Construct } from 'constructs';
[ng]                             ~~~~~~~~~~~~
[ng] 
[ng] 
[ng] Error: node_modules/@aws-amplify/plugin-types/lib/function_resources.d.ts:1:40 - error TS2307: Cannot find module 'aws-cdk-lib/aws-lambda' or its corresponding type declarations.
[ng] 
[ng] 1 import { CfnFunction, IFunction } from 'aws-cdk-lib/aws-lambda';
[ng]                                          ~~~~~~~~~~~~~~~~~~~~~~~~
[ng] 
[ng] 
[ng] Error: node_modules/@aws-amplify/plugin-types/lib/resource_access_acceptor.d.ts:1:24 - error TS2307: Cannot find module 'aws-cdk-lib/aws-iam' or its corresponding type declarations.
[ng] 
[ng] 1 import { Policy } from 'aws-cdk-lib/aws-iam';
[ng]                          ~~~~~~~~~~~~~~~~~~~~~
[ng] 
[ng] 
[ng] 

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

@simonramosb simonramosb added the pending-triage Issue is pending triage label Apr 17, 2024
@cwomack cwomack added GraphQL Related to GraphQL API issues Angular Related to Angular 2+ dependencies Pull requests that update a dependency file labels Apr 18, 2024
@cwomack
Copy link
Contributor

cwomack commented Apr 18, 2024

@simonramosb, thank you for opening this issue. Just to confirm, is this a Gen2 app that you're experiencing this in?

@cwomack cwomack added the pending-response Issue is pending response from the issue requestor label Apr 18, 2024
@simonramosb
Copy link
Author

Hey @cwomack! Thanks for your reply. No, the last team used this library just for handling connections to an appsync endpoint. Why? I dont really know haha. I'm here just for the typescript version, cause i can't upgrade angular.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue requestor label Apr 18, 2024
@chrisbonifacio chrisbonifacio removed the GraphQL Related to GraphQL API issues label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Angular Related to Angular 2+ dependencies Pull requests that update a dependency file pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

3 participants