Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to run a newly created dapp #73

Closed
pplanel opened this issue Jul 1, 2024 · 3 comments · Fixed by #74
Closed

Failed to run a newly created dapp #73

pplanel opened this issue Jul 1, 2024 · 3 comments · Fixed by #74
Assignees

Comments

@pplanel
Copy link

pplanel commented Jul 1, 2024

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
Copy link
Author

pplanel commented Jul 1, 2024

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').

@beeman beeman self-assigned this Jul 1, 2024
@beeman
Copy link
Collaborator

beeman commented Jul 1, 2024

Thanks for filing this issue @pplanel - I'll push up a fix.

@beeman
Copy link
Collaborator

beeman commented Jul 1, 2024

This is fixed in #74 and published under the next tag:

npx create-solana-dapp@next lottery-app --yarn --preset react --anchor basic --anchor-program lottery-app

@pplanel pplanel closed this as completed Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants