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

"Must define at least one file" error #80

Open
onemanstartup opened this issue Jan 27, 2015 · 14 comments
Open

"Must define at least one file" error #80

onemanstartup opened this issue Jan 27, 2015 · 14 comments

Comments

@onemanstartup
Copy link

Hi countryman, congrats on the holiday.
I'm getting this error, tried different settings, doesn't helped.

Must define at least one file.
Run `beautify.min.js -h` for help.
@maksimr
Copy link
Owner

maksimr commented Jan 27, 2015

Hi,

Thanks, congrats you to.

What OS you use?
What engine(node,v8,iojs) you use?
What configurations you tried?

@onemanstartup
Copy link
Author

I tried to install different versions of beautifiers, (tried changing editorconfig, but it seems it is not relevant)
I'm using Mac OS X Yosemite, node version is v0.10.33, tried in console vim and MacVim

@maksimr
Copy link
Owner

maksimr commented Jan 27, 2015

@onemanstartup can print how look this line when you run command.
Also will be cool if you run resulted line in terminal.

@onemanstartup
Copy link
Author

Uh. How do i run this? I don't familiar with vimscript. It will take time to figure out this.

@maksimr
Copy link
Owner

maksimr commented Jan 27, 2015

You can change this line on

echo engine." ".fnameescape(s:plugin_Root_directory."/beautify.min.js")." --js_arguments ".tmp_file_Beautifier_arg." ".opts_Beautifier_arg." ".path_Beautifier_arg)
return 1

@onemanstartup
Copy link
Author

Ok. Run through call ErrorMsg()

node /Users/onemanstartup/Code/dotfiles/vim2/bundle/vim-jsbeautify/plugin/beautify.min.js --js_arguments "/var/folders/hm/ng5h
j9t949s6ljmgzwng_7hh0000gp/T/vlj6gW0/0" "{\"indent_char\": \" \", \"path\": \"~/.nvim/bundle/vim-jsbeautify/plugin/lib/js/bin/j
s-beautify.js\", \"max_line_length\": \"79\", \"indent_style\": \"space\", \"indent_size\": \"2\", \"wrap-line-length\": \"79\"
, \"max_char\": \"79\"}" "/Users/onemanstartup/.nvim/bundle/vim-jsbeautify/plugin/lib/js/bin/js-beautify.js"'

@maksimr
Copy link
Owner

maksimr commented Jan 27, 2015

@onemanstartup Thanks!
Now try run this command in terminal

@onemanstartup
Copy link
Author

It tells the same thing. I cat tmp file and it is containing content of the file.
Also i ran js-beautify /var/folders/hm/ng5hj9t949s6ljmgzwng_7hh0000gp/T/vlj6gW0/0.js and it returned content.

@maksimr
Copy link
Owner

maksimr commented Jan 27, 2015

Hm.. try simple run node /Users/onemanstartup/Code/dotfiles/vim2/bundle/vim-jsbeautify/plugin/beautify.min.js

@onemanstartup
Copy link
Author

Here the error

fs.js:438
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
TypeError: path must be a string
    at Object.fs.openSync (fs.js:438:18)
    at Object.fs.readFileSync (fs.js:289:15)
    at read (/Users/onemanstartup/Code/dotfiles/vim2/bundle/vim-jsbeautify/plugin/beautify.min.js:1:1462)
    at /Users/onemanstartup/Code/dotfiles/vim2/bundle/vim-jsbeautify/plugin/beautify.min.js:1:1581
    at Object.<anonymous> (/Users/onemanstartup/Code/dotfiles/vim2/bundle/vim-jsbeautify/plugin/beautify.min.js:1:1982)
    at Object.<anonymous> (/Users/onemanstartup/Code/d

@maksimr
Copy link
Owner

maksimr commented Jan 27, 2015

Cool! now let's pass one parameter

node /Users/onemanstartup/Code/dotfiles/vim2/bundle/vim-jsbeautify/plugin/beautify.min.js --js_arguments "/var/folders/hm/ng5h
j9t949s6ljmgzwng_7hh0000gp/T/vlj6gW0/0"

@onemanstartup
Copy link
Author

Here there error


/Users/onemanstartup/Code/dotfiles/vim2/bundle/vim-jsbeautify/plugin/beautify.min.js:1
s=require("fs");load=function(path){var context={},property;if(path.charAt(0)!
                                                                    ^
TypeError: Cannot call method 'charAt' of undefined
    at load (/Users/onemanstartup/Code/dotfiles/vim2/bundle/vim-jsbeautify/plugin/beautify.min.js:1:1194)
    at /Users/onemanstartup/Code/dotfiles/vim2/bundle/vim-jsbeautify/plugin/beautify.min.js:1:1644
    at Object.<anonymous> (/Users/onemanstartup/Code/dotfiles/vim2/bundle/vim-jsbeautify/plugin/beautify.min.js:1:1982)
    at Object.<anonymous> (/Users/onemanstartup/Code/dotfiles/vim2/bundle/vim-jsbeautify/plugin/beautify.min.js:1:2011)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

@maksimr
Copy link
Owner

maksimr commented Jan 28, 2015

Good! Now with empty json

node /Users/onemanstartup/Code/dotfiles/vim2/bundle/vim-jsbeautify/plugin/beautify.min.js --js_arguments "/var/folders/hm/ng5h
j9t949s6ljmgzwng_7hh0000gp/T/vlj6gW0/0" "{}" "/Users/onemanstartup/.nvim/bundle/vim-jsbeautify/plugin/lib/js/bin/js-beautify.js"

@onemanstartup
Copy link
Author

It's the same Must define at least one file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants