gingerhendrix / broccoli-browserify

Browserify plugin for Broccoli
9 stars 23 forks source link

Error when creating bundle #2

Closed robmunro closed 10 years ago

robmunro commented 10 years ago

I get an error TypeError: Arguments to path.join must be strings when I try and build simple bundle.

Here is my current Brocfile.js

  var compileBrowserifyBundles = require('broccoli-browserify');
  var pickFiles = require('broccoli-static-compiler');

  var browserifyAssets = 'assets/jsBundles'
  browserifyAssetsTree = pickFiles(browserifyAssets, {
    srcDir: '/',
    files: ['**/*.js'],
    destDir: 'jsBundles/' // All files are served from "jsBundles/"?
  });

  // Process changes
  browserifyAppJs = compileBrowserifyBundles(browserifyAssetsTree, {
    entries: ['./jsBundles/bundleJs.js']
  });

  return browserifyAppJs;

Here is the error stack

tmp/static_compiler-tmp_dest_dir-S8uJchOO.tmp { basedir: 'tmp/static_compiler-tmp_dest_dir-S8uJchOO.tmp' }

path.js:360
        throw new TypeError('Arguments to path.join must be strings');
              ^
TypeError: Arguments to path.join must be strings
  at path.js:360:15
  at Array.filter (native)
  at Object.exports.join (path.js:358:36)
  at /Users/rob.munro/git/test/node_modules/broccoli-browserify/lib/index.js:40:29
  at /Users/rob.munro/git/test/node_modules/browserify/index.js:299:22
  at /Users/rob.munro/git/test/node_modules/browserify/index.js:299:22
  at /Users/rob.munro/git/test/node_modules/browserify/index.js:327:13
  at ConcatStream.<anonymous> (/Users/rob.munro/git/test/node_modules/browserify/node_modules/concat-stream/index.js:32:43)
  at ConcatStream.EventEmitter.emit (events.js:92:17)
  at finishMaybe (/Users/rob.munro/git/test/node_modules/browserify/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:450:14)
  at afterWrite (/Users/rob.munro/git/test/node_modules/browserify/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:330:3)
  at /Users/rob.munro/git/test/node_modules/browserify/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:317:9
  at process._tickCallback (node.js:415:13)
robmunro commented 10 years ago

Maybe a full example of this working would help?

gingerhendrix commented 10 years ago

Hi Rob,

I think outputFile is a required option that I've forgotten to document. I'm not at my home computer, but I do have a working skeleton app with browserify I'll push when I can.

robmunro commented 10 years ago

@gingerhendrix I just worked that out then - lol :) Cheers bud

robmunro commented 10 years ago

All good then - I'll close this issue :)