nicosantangelo / sublime-gulp

Run Gulp tasks and use snippets from Sublime Text
https://sublime-gulp.nicosantangelo.com/
MIT License
155 stars 18 forks source link

ValueError... at json.load(cache_file) #85

Closed Ivanca closed 7 years ago

Ivanca commented 7 years ago
Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "./python3.3/threading.py", line 858, in run
  File "C:\Users\Ivan\AppData\Roaming\Sublime Text 3\Packages\Gulp\gulp.py", line 220, in run_process
    process.run(task)
  File "C:\Users\Ivan\AppData\Roaming\Sublime Text 3\Packages\Gulp\cross_platform_process.py", line 41, in run
    ProcessCache.add(self)
  File "C:\Users\Ivan\AppData\Roaming\Sublime Text 3\Packages\Gulp\caches.py", line 40, in add
    cls.storage().update(lambda procs: procs + [process] if process not in procs else procs)
  File "C:\Users\Ivan\AppData\Roaming\Sublime Text 3\Packages\Gulp\caches.py", line 132, in update
    current_data = json.load(cache_file)
  File "./python3.3/json/__init__.py", line 271, in load
  File "./python3.3/json/__init__.py", line 316, in loads
  File "./python3.3/json/decoder.py", line 351, in decode
  File "./python3.3/json/decoder.py", line 367, in raw_decode
ValueError: 
Ivanca commented 7 years ago

Solution I was getting the error, after some debugging I found out the problem is that the json cache file this plugin uses was corrupted, the one at %userprofile%\AppData\Roaming\Sublime Text 3\Packages\Gulp\.sublime-gulp.cache so I deleted its content and put the default .sublime-gulp.cache content, meaning just [] (yeah, only those 2 characters in the file).

If you cant find the corrupted cache file open caches.py and add print("PATH: " + self.cache_path); so you can see its path in the console (View > Show Console)

Good luck

nicosantangelo commented 7 years ago

Thanks a lot for posting your solution. I'll keep it in mind for future issues!

Ivanca commented 7 years ago

@NicoSantangelo the file seems to be constantly getting corrupted somehow