I am getting error in react native typescript:-
[Error: undefined Unable to resolve module ./types from /home/ubuntu/Desktop/trash/solana_web3/test/src/start.ts: None of these files exist: * src/types(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.cjs|.native.cjs|.cjs|.android.svg|.native.svg|.svg) * src/types/index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.cjs|.native.cjs|.cjs|.android.svg|.native.svg|.svg)
In start.ts
I am importing types.d.ts
like this :-
import { bool, publicKey, u64 } from './types';// ... laterexport const AccountLayout = struct<RawAccount>([ publicKey('mint'), publicKey('owner'), u64('amount'), publicKey('delegate'), u64('isNative'), u64('delegatedAmount'), publicKey('closeAuthority'),]);
File types.d.ts
is :-
import { Layout } from '@solana/buffer-layout';export declare const bool: (property?: string | undefined) => Layout<boolean>;export declare const publicKey: (property?: string | undefined) => Layout<PublicKey>;export declare const bigInt: (length: number) => (property?: string | undefined) => Layout<bigint>;export declare const u64: (property?: string | undefined) => Layout<bigint>;
Please help why the error is coming.