1602 / compound

MVC framework. Built on Node.JS. Works on server and browser.
http://compoundjs.com
1.6k stars 183 forks source link

path.js:204 throw new TypeError('Arguments to path.join must be strings'); #632

Open sunny4u opened 9 years ago

sunny4u commented 9 years ago

path.js:204 throw new TypeError('Arguments to path.join must be strings'); ^ TypeError: Arguments to path.join must be strings at f (path.js:204:15) at Object.filter (native) at exports.join (path.js:209:40) at Array.map (native) at LESSCompiler.module.exports.LESSCompiler.getDependencies (C:\ECM\JS\Js_3\js_arch\node_modules\less-brunch\lib\index .js:71:10) at LESSCompiler.getDependencies (C:\ECM\JS\Js_3\js_arch\node_modules\less-brunch\lib\index.js:4:61) at getDependencies (C:\Users\mailas\AppData\Roaming\npm\node_modules\brunch\lib\fs_utils\pipeline.js:40:23) at C:\Users\mailas\AppData\Roaming\npm\node_modules\brunch\lib\fs_utils\pipeline.js:80:16 at C:\ECM\JS\Js_3\js_arch\node_modules\less-brunch\lib\index.js:49:16 at finish (C:\ECM\JS\Js_3\js_arch\node_modules\less-brunch\node_modules\less\lib\less\parser.js:434:40) at C:\ECM\JS\Js_3\js_arch\node_modules\less-brunch\node_modules\less\lib\less\parser.js:94:48 at C:\ECM\JS\Js_3\js_arch\node_modules\less-brunch\node_modules\less\lib\less\index.js:116:17 at Object.Parser.parser.parse as parse at C:\ECM\JS\Js_3\js_arch\node_modules\less-brunch\node_modules\less\lib\less\index.js:115:16 at fs.js:271:14 at Object.oncomplete (fs.js:107:15)

alexbaumgertner commented 9 years ago

Could you show your less slyle files? Probably you are trying to compile someone invalid .less file.

sunny4u commented 9 years ago

// Generated by CoffeeScript 1.3.3 (function() { var LESSCompiler, less, sysPath, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

less = require('less');

sysPath = require('path');

module.exports = LESSCompiler = (function() {

LESSCompiler.prototype.brunchPlugin = true;

LESSCompiler.prototype.type = 'stylesheet';

LESSCompiler.prototype.extension = 'less';

LESSCompiler.prototype._dependencyRegExp = /@import ['"](.*)['"]/g;

function LESSCompiler(config) {
  this.config = config;
  this.getDependencies = __bind(this.getDependencies, this);

  null;
}

LESSCompiler.prototype.compile = function(data, path, callback) {
  var parser,
    _this = this;
  parser = new less.Parser({
    paths: [this.config.paths.root, sysPath.dirname(path)],
    filename: path
  });
  return parser.parse(data, function(error, tree) {
    var err, result;
    if (error != null) {
      return callback(error.message);
    }
    result = null;
    err = null;
    try {
      result = tree.toCSS();
    } catch (ex) {
      err = "" + ex.type + "Error:" + ex.message;
      if (ex.filename) {
        err += " in '" + ex.filename + ":" + ex.line + ":" + ex.column + "'";
      }
    }
    return callback(err, result);
  });
};

LESSCompiler.prototype.getDependencies = function(data, path, callback) {
  var dependencies, parent, paths,
    _this = this;
  paths = data.match(this._dependencyRegExp) || [];
  parent = sysPath.dirname(path);
  dependencies = paths.map(function(path) {
    var res;
    res = _this._dependencyRegExp.exec(path);
    _this._dependencyRegExp.lastIndex = 0;
    return (res || [])[1];
  }).filter(function(path) {
    return !!path;
  }).map(function(path) {
    if (sysPath.extname(path) !== ("." + _this.extension)) {
      return path + ("." + _this.extension);
    } else {
      return path;
    }
  }).map(sysPath.join.bind(null, parent));
  return process.nextTick(function() {
    return callback(null, dependencies);
  });
};

return LESSCompiler;

})();

}).call(this);

alexbaumgertner commented 9 years ago

Oh, I mean your less style files from public/stylesheets/. :)

alexbaumgertner commented 9 years ago

From top code: I see sysPath.join.bind(null, parent)); then looking up and see parent = sysPath.dirname(path);, finally LESSCompiler.prototype.getDependencies = function(data, path, callback) {,

maybe path param contain wrong value.

sunny4u commented 9 years ago

don't see any public/stylesheets/..?

alexbaumgertner commented 9 years ago

Maybe, in / app / assets / stylesheets?

alexbaumgertner commented 9 years ago

In general, you should find .less style files in your project and validate them.

sunny4u commented 9 years ago

Hi Alex,

Above issue got fixed and now am seeing different below error.

33mwarn←[0m: -c, --config option is deprecated. Use --env in config.overrides instead

Thanks, Sunny

On Thu, Jul 31, 2014 at 7:26 AM, Alex Baumgertner notifications@github.com wrote:

In general, you should find .less style files in your project and validate them.

— Reply to this email directly or view it on GitHub https://github.com/1602/compound/issues/632#issuecomment-50751256.

alexbaumgertner commented 9 years ago

Do you use assets-compiler or another compiler (by grunt or gulp)? It's strange warning...:

warn←[0m: `-c, --config` option is deprecated. Use `--env` in `config.overrides` instead