LoginSignup
10
3

More than 3 years have passed since last update.

AWS Amplify のエラー対処 Could not find a declaration file for module 'graphql/language/ast'.

Posted at

発生した問題

ビルド実行時に下記のエラーが出る

1:30 Could not find a declaration file for module 'graphql/language/ast'. 

  Try `npm install @types/graphql` if it exists or add a new declaration (.d.ts) file co
ntaining `declare module 'graphql/language/ast';`
  > 1 | import { DocumentNode } from 'graphql/language/ast';
      |                              ^
    2 | export interface GraphQLOptions {
    3 |     query: string | DocumentNode;
    4 |     variables?: object;

 ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! front@0.1.0 build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the front@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

対処1

下記のコマンドを実行し、ビルドしたがダメだった

npm install @types/graphql

対処2

@types を抜いてインストールし、ビルドすると成功した。

npm install graphql
10
3
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
3