Failed to run a newly created dapp
Closed this issue · 3 comments
pplanel commented
Hello, newly created dapp cannot run with several erros:
WARNING in ../anchor/src/lottery-app-exports.ts 9:0-25
export 'IDL' (reexported as 'LotteryAppIDL') was not found in '../target/types/lottery_app' (module has no exports)
WARNING in ../anchor/src/lottery-app-exports.ts 12:52-73
export 'IDL' (imported as 'LotteryAppIDL') was not found in '../target/types/lottery_app' (module has no exports)
WARNING in ../anchor/src/lottery-app-exports.ts 16:21-34
export 'IDL' (imported as 'LotteryAppIDL') was not found in '../target/types/lottery_app' (module has no exports)
WARNING in ./src/app/lottery-app/lottery-app-data-access.tsx 26:51-60
export 'programId' (imported as 'programId') was not found in '@lottery-app/anchor' (possible exports: LOTTERY_APP_PROGRAM_ID, LotteryAppIDL, getLotteryAppProgram)
WARNING in ./src/app/lottery-app/lottery-app-data-access.tsx 40:4-13
export 'programId' (imported as 'programId') was not found in '@lottery-app/anchor' (possible exports: LOTTERY_APP_PROGRAM_ID, LotteryAppIDL, getLotteryAppProgram)
WARNING in ../node_modules/asn1.js/lib/asn1/api.js 21:12-42
Module not found: Error: Can't resolve 'vm' in '/Users/pplanel/src/pplanel/solana/lottery-app/node_modules/asn1.js/lib/asn1'
ERROR in ./anchor/src/lottery-app-exports.ts:5:10
TS2305: Module '"../target/types/lottery_app"' has no exported member 'IDL'.
3 | import { PublicKey } from '@solana/web3.js';
4 | import type { LotteryApp } from '../target/types/lottery_app';
> 5 | import { IDL as LotteryAppIDL } from '../target/types/lottery_app';
| ^^^
6 |
7 | // Re-export the generated IDL and type
8 | export { LotteryApp, LotteryAppIDL };
ERROR in ./web/src/app/lottery-app/lottery-app-data-access.tsx:1:10
TS2305: Module '"@lottery-app/anchor"' has no exported member 'programId'.
> 1 | import { programId, getLotteryAppProgram } from '@lottery-app/anchor';
| ^^^^^^^^^
Versions
anchor-cli 0.30.0
solana-cli 1.18.8 (src:e2d34d37; feat:3469865029, client:SolanaLabs)
rustc 1.79.0 (129f3b996 2024-06-10)
Steps to reproduce
npx create-solana-dapp lottery-app --yarn --preset react --anchor basic --anchor-program lottery-app
cd lottery-app
yarn
yarn run anchor build
yarn run dev
pplanel commented
Running on @next
same error:
⚠ ../anchor/src/lottery-app-exports.ts
export 'IDL' (reexported as 'LotteryAppIDL') was not found in '../target/types/lottery_app' (module has no exports)
Import trace for requested module:
../anchor/src/lottery-app-exports.ts
../anchor/src/index.ts
./components/lottery-app/lottery-app-data-access.tsx
./components/lottery-app/lottery-app-feature.tsx
../anchor/src/lottery-app-exports.ts
Attempted import error: 'IDL' is not exported from '../target/types/lottery_app' (imported as 'LotteryAppIDL').