-
Notifications
You must be signed in to change notification settings - Fork 70
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
Local Development Server crashing upon clicking Run Code
#80
Comments
@Rishabh-malhotraa I set up the project again and I am now able to fetch the problems from codeforces and leetcode problems list is also available, messaging feature also seems fine but the code is not getting compiled. P.S - I haven't created any .env files this time as I have followed these instructions. |
Run Code
Run Code
You should not need to create a .env file as config.keys add default values if .env file is not created, you would require to create a .env file if you need to add your oauth token credentials etc.
(For adding jdoodle credentials you need to create and .env file)
|
@Rishabh-malhotraa I made the changes you mentioned -
But the app is getting crashed when I am clicking on run code button. |
Why it is returning an unauthorized status code? |
I you are getting unauthorized, that means your tokens are incorrect, can you recheck your tokens, you require two of them |
@Rishabh-malhotraa I doubted same, and I therefore checked the secrets 4-5 times. My .env file
This is what I get from JDOODLE credentials tab - I believe that they both are the same. |
I also tried refreshing credentials and getting a new client secret but the error remains the same. |
I think it's your still your credential keys issue you can try getting your keys from a different account for now, you can use these keys, but I'll refresh them tomorrow so you would not be able to use them after tomorrow, so maybe try getting the keys from a different account.
|
you need to restart the server once you update the env file |
Also, one more thing to note is that if I click run code on empty code, it doesn't throw any error. That means - We are reaching out to some part of the the /execute endpoint - router.post("/execute", async (req, res) => {
const { script, language, stdin } = req.body;
if (!language || !script) {
return res.status(200).json({
message: "Code should not be empty and Language undefined",
});
}
const response = await axios({
method: "POST",
url: `${JDOODLE_URL}/execute`,
data: {
script: script,
stdin: stdin,
language: getLanguage[language],
versionIndex: getLanguageVersion[language],
clientId: JDOODLE.clientID,
clientSecret: JDOODLE.clientSecret,
},
responseType: "json",
});
res.json(response.data);
}); |
@Rishabh-malhotraa Did you get a chance to investigate further? |
Can you try running on incognito and maybe do a reinstall of Caucus with latest commit(don't add any env file in the clean install as the config file contains the credentials now) |
This finally worked. Thanks, @Rishabh-malhotraa for helping me set up the project. |
Describe the bug
A clear and concise description of what the bug is.
Add a code snippet in editor.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The app shouldn't crash and the program should compile successfully.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: