flycheck / flycheck-rust

Better Rust/Cargo support for Flycheck

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

File mode specification error: (json-readtable-error)

bbigras opened this issue · comments

I got this error when I try to open a rust file. Not sure if it's a problem with flycheck or flycheck-rust.

GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.9) of 2016-09-18

File mode specification error: (json-readtable-error)
json-read: JSON readtable error
Error in post-command-hook (global-flycheck-mode-check-buffers): (json-readtable-error)

Can you retry with debug-on-error?

I can't reproduce anymore. I'll report if I have this bug again.

I hit a similar error in typescript. Problem was that typescript was not available on the PATH. Thus it would crash like this:

Debugger entered--Lisp error: (json-readtable-error)
  signal(json-readtable-error nil)
  json-read()
  json-read-from-string("module.js:491\n    throw err;\n    ^\n\nError: Cannot find module 'typescript'\n    at Function.Module._resolveFilename (module.js:489:15)\n    at Function.Module._load (module.js:439:25)\n    at Module.require (module.js:517:17)\n    at require (internal/module.js:11:18)\n    at Object.<anonymous> (/usr/lib/node_modules/tslint/lib/linter.js:20:10)\n    at Module._compile (module.js:573:30)\n    at Object.Module._extensions..js (module.js:584:10)\n    at Module.load (module.js:507:32)\n    at tryModuleLoad (module.js:470:12)\n    at Function.Module._load (module.js:462:3)\n")
  flycheck-parse-tslint("module.js:491\n    throw err;\n    ^\n\nError: Cannot find module 'typescript'\n    at Function.Module._resolveFilename (module.js:489:15)\n    at Function.Module._load (module.js:439:25)\n    at Module.require (module.js:517:17)\n    at require (internal/module.js:11:18)\n    at Object.<anonymous> (/usr/lib/node_modules/tslint/lib/linter.js:20:10)\n    at Module._compile (module.js:573:30)\n    at Object.Module._extensions..js (module.js:584:10)\n    at Module.load (module.js:507:32)\n    at tryModuleLoad (module.js:470:12)\n    at Function.Module._load (module.js:462:3)\n" typescript-tslint #<buffer user-service.ts>)
  flycheck-parse-output("module.js:491\n    throw err;\n    ^\n\nError: Cannot find module 'typescript'\n    at Function.Module._resolveFilename (module.js:489:15)\n    at Function.Module._load (module.js:439:25)\n    at Module.require (module.js:517:17)\n    at require (internal/module.js:11:18)\n    at Object.<anonymous> (/usr/lib/node_modules/tslint/lib/linter.js:20:10)\n    at Module._compile (module.js:573:30)\n    at Object.Module._extensions..js (module.js:584:10)\n    at Module.load (module.js:507:32)\n    at tryModuleLoad (module.js:470:12)\n    at Function.Module._load (module.js:462:3)\n" typescript-tslint #<buffer user-service.ts>)
  flycheck-finish-checker-process(typescript-tslint 1 ("/tmp/flycheck1344811g/user-service.ts" "/tmp/flycheck1344811g") "module.js:491\n    throw err;\n    ^\n\nError: Cannot find module 'typescript'\n    at Function.Module._resolveFilename (module.js:489:15)\n    at Function.Module._load (module.js:439:25)\n    at Module.require (module.js:517:17)\n    at require (internal/module.js:11:18)\n    at Object.<anonymous> (/usr/lib/node_modules/tslint/lib/linter.js:20:10)\n    at Module._compile (module.js:573:30)\n    at Object.Module._extensions..js (module.js:584:10)\n    at Module.load (module.js:507:32)\n    at tryModuleLoad (module.js:470:12)\n    at Function.Module._load (module.js:462:3)\n" #[128 "\301\302\300�#\207" [[cl-struct-flycheck-syntax-check #<buffer user-service.ts> typescript-tslint #<process flycheck-typescript-tslint> "<REDACTED>"] apply flycheck-report-buffer-checker-status] 5 "\n\n(fn &rest ARGS)"] "<REDACTED>")
  flycheck-handle-signal(#<process flycheck-typescript-tslint> "exited abnormally with code 1\n")

Installing typescript globally solved the issue.

I guess it would be better if flycheck failed with a more obvious error than 'json-readtable-error'

@lunaryorn Possible to re-open this and track improving the error message here? Or do you want a new bug for that?

I do not maintain Flycheck any longer; I'm not even using Emacs anymore.

In doubt open a new issue but please do not mention me. I'm sorry but I can't help you :)

@stieg Can you open a new issue on flycheck/flycheck proper? This issue tracker is for bugs related to flycheck-rust specifically.

@fmdkdd Sure. Cheers.