clearloop / leetcode-cli

May the code be with you 👻
MIT License
317 stars 54 forks source link

standart out to long #154

Open routerdieb opened 4 months ago

routerdieb commented 4 months ago

So i was debugging code with long print calls. And then i got " JSON error: expected value at line 1 column 1, please double check your session and csrf config. JSON error: expected value at line 1 column 1, please double check your session and csrf config"

But one the website my code is working.

Minimal example that produces the error: ( on execises 26 in python3)

from typing import *
class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        print(f'nums are now {nums} and u')
        return 1 
clearloop commented 4 months ago

this could be a problem that your session is outdated, see Cookies, or the network was currently just bad ( got invalid JSON response ) ...

Ideally, we should provide more detailed errors on receiving invalid JSON responses, for example checking the status code in this kind of places https://github.com/clearloop/leetcode-cli/blob/master/src/plugins/leetcode.rs#L78

PRs are welcome ^ ^

routerdieb commented 4 months ago

Ok, but this code is valid (just a few letters less). So i guess it is not about the csrf token.

from typing import *
class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        print(f'nums are now {nums}')
        return 1
clearloop commented 4 months ago

Ok, but this code is valid (just a few letters less). So i guess it is not about the csrf token.

from typing import *
class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        print(f'nums are now {nums}')
        return 1

oh it's not about the code itself, but the http requests and the cookies, the code was not sent to leetcode's server correctly

pablo-cardenas commented 4 months ago

I also have the same problem. It worked well three days ago.