onflow / kitty-items

Kitty Items: CryptoKitties Sample App
https://kitty-items.onflow.org
Apache License 2.0
408 stars 213 forks source link

dev:emulator wallet or login is not working #312

Closed WonderJL closed 2 months ago

WonderJL commented 1 year ago

Describe the bug

I pull the lastest commit and run npm run dev:emulator successfully to kickstart the project. Can access to locahost:3001 normally, but get errro when click the login button. And I try login in localhost:8701 also get errors.

Any idea how to fix this?

To Reproduce Steps to reproduce the behavior:

  1. git clone
  2. npm install
  3. npm run dev:emulator
  4. go to localhost:3001
  5. click login

Expected behavior The emulator wallet can login successfully.

Screenshots/Logs/Output

here are those error screencap:

image image image

Environment (Optional - Version, OS, Browser, etc.) flow version Version: v0.41.2

git commit 271850593e951d06b16fa548faf31e287737d7d1 (HEAD -> master, origin/master, origin/HEAD)

Macbook pro M1 macOS Monterey Version 12.6

Additional context (Optional - Anything else about the bug)

log of npm run dev:emulator:

npm run dev:emulator

> kitty-items@1.0.0 dev:emulator
> npx cross-env CHAIN_ENV=emulator node .ki-scripts/startup.js

ℹ Stopping previously launched processes...

✔ Emulator started
ℹ Flow Emulator is running at: http://localhost:8080
ℹ View log output: npx pm2 logs emulator

✔ Developer Wallet started
ℹ FCL Dev Wallet running at: http://localhost:8701
ℹ View log output: npx pm2 logs dev-wallet

✔ Contracts deployed
ℹ Contracts were deployed to: 0xf8d6e0586b0a20c7 (emulator)

ℹ Initializing Kitty Items
ℹ Initializing NFTStorefront
✔ Admin account initialized
ℹ ./cadence/transactions/nftStorefront/setup_account.cdc was executed successfully.
ℹ ./cadence/transactions/kittyItems/setup_account.cdc was executed successfully.

✔ API server started
ℹ Kitty Items API is running at: http://localhost:3000
ℹ View log output: npx pm2 logs api

✔ Storefront web app started
ℹ Kitty Items Web App is running at: http://localhost:3001
ℹ View log output: npx pm2 logs web

KITTY ITEMS HAS STARTED

Visit: http://localhost:3001

? Would you like to view the logs for all processes? Yes

pm2 launched in no-daemon mode (you can add DEBUG="*" env variable to get more messages)
/Users/j.leung/.pm2/pm2.log last 15 lines:
PM2        | 2022-10-25T16:12:29: PM2 log: App [emulator:0] starting in -fork mode-
PM2        | 2022-10-25T16:12:32: PM2 log: App [emulator:0] online
PM2        | 2022-10-25T16:12:33: PM2 log: App [dev-wallet:1] starting in -fork mode-
PM2        | 2022-10-25T16:12:36: PM2 log: App [dev-wallet:1] online
PM2        | 2022-10-25T16:12:36: PM2 log: App [api:2] starting in -fork mode-
PM2        | 2022-10-25T16:12:39: PM2 log: App [api:2] online
PM2        | 2022-10-25T16:12:39: PM2 log: App [web:3] starting in -fork mode-
PM2        | 2022-10-25T16:12:42: PM2 log: App [web:3] online

/Users/j.leung/.pm2/logs/emulator-error.log last 15 lines:
/Users/j.leung/.pm2/logs/dev-wallet-error.log last 15 lines:
/Users/j.leung/.pm2/logs/web-error.log last 15 lines:
/Users/j.leung/.pm2/logs/dev-wallet-out.log last 15 lines:
1|dev-wall | 
1|dev-wall | ❗   Version warning: a new version of Flow CLI is available (v0.41.1).
1|dev-wall |    Read the installation guide for upgrade instructions: https://docs.onflow.org/flow-cli/install
1|dev-wall | 
1|dev-wall | 🎉 Starting dev wallet server on port 8701
1|dev-wall | ❗   Make sure the emulator is running

/Users/j.leung/.pm2/logs/emulator-out.log last 15 lines:
0|emulator | time="2022-10-25T16:12:30+08:00" level=info msg="📜  Flow contract" FungibleToken=0xee82856bf20e2aa6
0|emulator | time="2022-10-25T16:12:30+08:00" level=info msg="📜  Flow contract" FlowFees=0xe5a8b7f23e8b548f
0|emulator | time="2022-10-25T16:12:30+08:00" level=info msg="📜  Flow contract" FlowStorageFees=0xf8d6e0586b0a20c7
0|emulator | time="2022-10-25T16:12:30+08:00" level=info msg="🌱  Starting gRPC server on port 3569" port=3569
0|emulator | time="2022-10-25T16:12:30+08:00" level=info msg="🌱  Starting REST API on port 8888" port=8888
0|emulator | time="2022-10-25T16:12:30+08:00" level=info msg="🌱  Starting admin server on port 8080" port=8080
0|emulator | time="2022-10-25T16:12:30+08:00" level=info msg="✅  Started REST API server on port 8888" port=8888
0|emulator | time="2022-10-25T16:12:30+08:00" level=info msg="✅  Started admin server on port 8080" port=8080
0|emulator | time="2022-10-25T16:12:30+08:00" level=info msg="✅  Started gRPC server on port 3569" port=3569
0|emulator | time="2022-10-25T16:12:36+08:00" level=info msg="⭐  Transaction executed" computationUsed=3 txID=d23a491272609a2aabccb2fc04f20912fd798f861d3cade08d7f18627343519d
0|emulator | time="2022-10-25T16:12:36+08:00" level=info msg="⭐  Transaction executed" computationUsed=5 txID=6a810dfc93f2d5ab10c1a0c8b728a37f245e9efa2f22e8d84a892f14c74a4a3b
0|emulator | time="2022-10-25T16:12:36+08:00" level=info msg="⭐  Transaction executed" computationUsed=3 txID=77ce336b4b67271f5ecc91e3275e107a6f4d4d2e3148bc80a10c931bfffa82e2
0|emulator | time="2022-10-25T16:12:36+08:00" level=info msg="⭐  Transaction executed" computationUsed=22 txID=84a31f17b66d579136b093b66c110aee57f2e14c6ab624c1d5bb5e8be5de0fe6
0|emulator | time="2022-10-25T16:12:36+08:00" level=info msg="⭐  Transaction executed" computationUsed=2 txID=af3076d3b14be8137b71bce02fc5bdb8465121721ec98d3cb24e5254eee747f3
0|emulator | time="2022-10-25T16:12:36+08:00" level=info msg="⭐  Transaction executed" computationUsed=14 txID=55812cc8ba2391a92231c2dbe953f04bca411743028d4e39e2fe83016d163ddd

/Users/j.leung/.pm2/logs/api-out.log last 15 lines:
2|api      | Starting Flow event worker ....
2|api      | start event polling
2|api      | Starting API server ....
2|api      | Listening on port 3000!
2|api      | [ERROR] 16:12:39 HTTP Request Error: 
2|api      |       HTTP Request Error: An error occurred when interacting with the Access API.
2|api      |       error=request to http://localhost:8888/v1/blocks?height=sealed&expand=payload failed, reason: connect ECONNREFUSED ::1:8888
2|api      |       hostname=http://localhost:8888
2|api      |       path=/v1/blocks?height=sealed&expand=payload
2|api      |       method=GET
2|api      |       
2|api      |       
2|api      |       
2|api      |       
2|api      |     

/Users/j.leung/.pm2/logs/api-error.log last 15 lines:
2|api      |       hostname=http://localhost:8888
2|api      |       path=/v1/blocks?height=sealed&expand=payload
2|api      |       method=GET
2|api      |       
2|api      |       
2|api      |       
2|api      |       
2|api      |     
2|api      |     at _callee2$ (/Users/j.leung/workspace/code/js/scmp/artifacts/kitty-items/api/node_modules/@onflow/transport-http/src/http-request.js:118:15)
2|api      |     at tryCatch (/Users/j.leung/workspace/code/js/scmp/artifacts/kitty-items/api/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:86:17)
2|api      |     at Generator._invoke (/Users/j.leung/workspace/code/js/scmp/artifacts/kitty-items/api/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:66:24)
2|api      |     at Generator.next (/Users/j.leung/workspace/code/js/scmp/artifacts/kitty-items/api/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:117:21)
2|api      |     at asyncGeneratorStep (/Users/j.leung/workspace/code/js/scmp/artifacts/kitty-items/api/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
2|api      |     at _next (/Users/j.leung/workspace/code/js/scmp/artifacts/kitty-items/api/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
2|api      |     at processTicksAndRejections (node:internal/process/task_queues:96:5)

/Users/j.leung/.pm2/logs/web-out.log last 15 lines:
3|web      | 
3|web      | > kitty-items-web@0.2.0 dev
3|web      | > next dev -p 3001
3|web      | 
3|web      | ready - started server on 0.0.0.0:3001, url: http://localhost:3001
3|web      | info  - Loaded env from /Users/j.leung/workspace/code/js/scmp/artifacts/kitty-items/web/.env.local
3|web      | event - compiled client and server successfully in 1088 ms (618 modules)
3|web      | wait  - compiling /_error (client and server)...
3|web      | event - compiled client and server successfully in 222 ms (618 modules)

3|web  | mixpanel not available in node.js yet. Todo implement https://github.com/mixpanel/mixpanel-node
3|web  | warn  - You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.
3|web  | See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404
3|web  | warn  - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
3|web  | wait  - compiling / (client and server)...
3|web  | event - compiled client and server successfully in 255 ms (661 modules)
3|web  | mixpanel not available in node.js yet. Todo implement https://github.com/mixpanel/mixpanel-node
codingone21 commented 1 year ago

Thank you for reporting this. I'm unable to reproduce this error on the latest master branch. Could you make sure you have the latest Flow CLI (how to upgrade: https://developers.flow.com/tools/flow-cli/install) and restart the run?

joshuahannan commented 2 months ago

closing because we are archiving in favor of the flow app quickstart