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

the game is working but i am getting leaderboard error #5

Open
View-my-Git-Lab-krafi opened this issue Apr 25, 2023 · 1 comment
Open

Comments

@View-my-Git-Lab-krafi
Copy link

Unhandled Runtime Error
Error: An error occurred while fetching the data.

Source
src/hooks/useLeaderboard.ts (39:12) @ _callee$

37 | });
38 | if (!res.ok) {

39 | throw new Error('An error occurred while fetching the data.');
| ^
40 | }
41 | return res.json();
42 | };
Call Stack
tryCatch
node_modules/next/dist/compiled/regenerator-runtime/runtime.js (45:15)
Generator.invoke [as _invoke]
node_modules/next/dist/compiled/regenerator-runtime/runtime.js (274:0)
prototype. [as next]
node_modules/next/dist/compiled/regenerator-runtime/runtime.js (97:0)
asyncGeneratorStep
node_modules/@swc/helpers/src/_async_to_generator.mjs (3:0)
_next
node_modules/@swc/helpers/src/_async_to_generator.mjs (25:0)

@View-my-Git-Lab-krafi
Copy link
Author

View-my-Git-Lab-krafi commented Apr 25, 2023

The project code is impressive, but it lacks documentation, which can make it difficult to figure out how to configure. To start the project, navigate to the /app directory and use the command 'yarn dev.' Next, open another terminal and go to the /socket directory. From there, use the commands 'npm install' and 'npm start.'

It's important to note that the socket expects to see the app running on port 3000, as specified in the code at /monkeytype-clone/socket/build/index.js.
exports.io = new socket_io_1.Server(server, { cors: { origin: [ "http://localhost:3000", "https://mtype.vercel.app", "https://monkeytype-clone.vercel.app", "https://typez.vercel.app", ], methods: ["GET", "POST"], }, });

Additionally, the code at /monkeytype-clone/app/src/node_modules/next/dist/compiled/regenerator-runtime/runtime.js includes the line 'const API_URL = process.env.NEXT_PUBLIC_API_URL;' dont touch anything !

To configure the project, create a .env variable on the /app dir with the command 'nano .env'( i am using nano editor) and include the following line: 'NEXT_PUBLIC_API_URL=http://localhost:8080/graphql.'

Although the project code is impressive, it's crucial to have clear and comprehensive documentation to help users understand how to set it up and use it. I recommend updating the documentation to provide clear instructions on how to configure the project, including all dependencies and configurations required for successful operation.

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

No branches or pull requests

1 participant