-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
APIRelated to REST API issuesRelated to REST API issues
Description
Describe the bug
Since the addition of the linked line, our builds have been failing with:
<truncated>/@aws-amplify/api/lib/types/index.d.ts
ERROR in <truncated>/node_modules/@aws-amplify/api/lib/types/index.d.ts(1,30):
TS7016: Could not find a declaration file for module 'graphql/language/ast'. '<truncated>/node_modules/graphql/language/ast.js' implicitly has an 'any' type.
Try `npm install @types/graphql` if it exists or add a new declaration (.d.ts) file containing `declare module 'graphql/language/ast';`
We are using [email protected] and @aws-amplify/[email protected]. Our tsconfig.json is:
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "build/dist",
"module": "esnext",
"target": "es5",
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": false,
"typeRoots": [
"./typings/", "./node_modules/@types/"
]
},
"exclude": [
"node_modules",
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest",
"src/setupTests.ts"
]
}
I can work-around the issue with the following steps
- Add @types/graphql as a dev dependency
- Change typsecript lib ( tsconfig.json: compilerOptions.lib: ["esnext", "dom"])
At the moment, we aren't using graphql, so the graphql dependency is a little unfortunate.
To Reproduce
Steps to reproduce the behavior:
- Create a new typescript app (we use create-react-app-ts)
- Add a dependency on @aws-amplify/api
- Try to build
- See error
Expected behavior
When not using graphql, I shouldn't have to use graphql types.
Screenshots
N/A
Desktop (please complete the following information):
- OS: Ubuntu
- Browser: Any
- Version Any
chrstnbrn, samuelcastro, ls-jingbo-jin, douglas-mason, toritroniks and 15 more
Metadata
Metadata
Assignees
Labels
APIRelated to REST API issuesRelated to REST API issues