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

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

Open
sunny4u opened this issue Jul 30, 2014 · 9 comments
Open

Comments

@sunny4u
Copy link

sunny4u commented Jul 30, 2014

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
Copy link

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

@sunny4u
Copy link
Author

sunny4u commented Jul 30, 2014

// 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
Copy link

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

@alexbaumgertner
Copy link

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
Copy link
Author

sunny4u commented Jul 30, 2014

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

@alexbaumgertner
Copy link

Maybe, in / app / assets / stylesheets?

@alexbaumgertner
Copy link

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

@sunny4u
Copy link
Author

sunny4u commented Jul 31, 2014

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 [email protected]
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
#632 (comment).

@alexbaumgertner
Copy link

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

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

No branches or pull requests

2 participants