Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6369

Trying to import gql files error 2307 in react native with typescript

$
0
0

In the code, import shows the error"Cannot find module './somefile.gql' or its corresponding type declarations.ts(2307)", but I can actually run the app in a device

Problem comes as I want to commit and husky (pre commit hook) catch the error and can't deploy the code

Update: Already have plugin "babel-plugin-import-graphql" in .babelrc, I guess thats why it builds fine, husky runs tsc and so catch the error

import {  getWorkspaces as GET_WORKSPACES,  getCurrentWorkspace as GET_WORKSPACE,} from '../../graphql/queries/workspaces.gql';

error says

Cannot find module '../../graphql/queries/workspaces.gql' or its corresponding type declarations.ts(2307)

Viewing all articles
Browse latest Browse all 6369

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>