-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Cannot use namespace 'DocumentNode' as a type. #2362
Comments
#2365 related |
- Add type guard for DocumentNode - Refactor `getGraphqlOperationType` Fixes aws-amplify#2365 Fixes aws-amplify#2362
After adding @types/graphql, I got another error related to AmplifyUI. So for now I have to use an older version 1.1.10 |
Does anyone know how to fix this error when building AOT build? ERROR in node_modules/aws-amplify-angular/dist/src/components/xr/sumerian-scene-component/sumerian-scene.component.core.d.ts(14,16): error TS2709: Cannot use namespace 'AmplifyUI' as a type. I have reviewed the aws-amplify-angular project and cannot see any package dependency for @aws-amplify/ui |
I have the same problem @hoang-innomizetech. Actually, all the times I try to use aws-amplify it's unstable. :( |
Yeah. Currently, it blocking us migrate to latest version to get some bug fixes :( |
@fredericomaia10 have you able to get this issue fixed? |
@hoang-innomizetech unfortunately no. |
@fredericomaia10 What's worse is that they parked their old repository and forced everyone over to this, and it barely works. |
Any update on this? This is fix is urgent for me |
Adding |
Just installing the latest |
@xaviertorgerson @Exomus The DocumentNode issue can be fixed when installing the latest @types/graphql package, but when we are trying to build Angular AOT release, we are getting another error related to the AmplifyUI that I have reported above. This does not happen when we use aws-amplify-angular: 2.0.13 version. |
I don't know how to get rid of this error right now |
The fix seems to be to change the api/lib/types/index.d.ts line to the following because there is nothing in the graphql/language/ast file to import. I'm assuming the graphql dependency changed their code and ended up breaking this somehow?
See https://github.com/graphql/graphql-js/blob/master/src/index.js. |
Current fix for me (which also removes the unused graphql dependency) is to use modular imports and not the whole amplify package. See #2401 (comment) |
Yeah, I upgraded to latest version and also uninstall the graphql dependency and it is worked. But it is only worked when we added the skipLibCheck: true to the tsconfig.json file, I think this fine as long as we don't want to check the type for lib dependencies. After adding skipLibCheck option, the issue related to the AmplifyUI also fixed. So I am closing this ticket |
just upgraded Angular6 project to 8 and having issues with AWS-Amplify-angular similar to @hoang-innomizetech above. 15 amplifyUI: AmplifyUI; 6 AmplifyUI: AmplifyUI; 5 amplifyUI: AmplifyUI; running: Package Version@angular-devkit/architect 0.802.1 package dependencies: node version 10.9.0 |
I temporarily fixed it and got it compiling by adding |
@AdamShechter9 Did you try my solution as mentioned above
|
@hoang-innomizetech I would ideally not want to skip type check for dependencies. Can we get a better fix for this? |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
I am getting below error when using this module. Does anyone know the root cause?
When running with webpack
ERROR in node_modules/@aws-amplify/api/lib/types/index.d.ts(45,21): error TS2709: Cannot use namespace 'DocumentNode' as a type.
AOT build error
ERROR in node_modules/@aws-amplify/api/lib/types/index.d.ts(45,21): error TS2709: Cannot use namespace 'DocumentNode' as a type.
node_modules/aws-amplify-angular/dist/src/components/xr/sumerian-scene-component/sumerian-scene.component.core.d.ts(14,16): error TS2709: Cannot use namespace 'AmplifyUI' as a type.
node_modules/aws-amplify-angular/dist/src/components/xr/sumerian-scene-component/sumerian-scene-loading.component.core.d.ts(6,16): error TS2709: Cannot use namespace 'AmplifyUI' as a type.
node_modules/aws-amplify-angular/dist/src/components/xr/sumerian-scene-component/sumerian-scene.component.ionic.d.ts(5,16): error TS2709: Cannot use namespace 'AmplifyUI' as a type.
angular: 7.1.3
typescript: 3.16
aws-amplify: 1.1.17
aws-amplify-angular: 2.14
The text was updated successfully, but these errors were encountered: