carrot / roots-browserify

Roots v3 extension that uses browserify as a javascript pipeline
Other
21 stars 8 forks source link

errors when compiling with roots #4

Closed pruett closed 9 years ago

pruett commented 10 years ago

running roots watch in version 3.0.0-rc.6 produces the following error:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Parsing file ...application.coffee: Line 1: Unexpected string
  at parseDeps (/Users/kevin/Code/crosscourt-ui/node_modules/roots-browserify/node_modules/browserify/node_modules/module-deps/index.js:249:45)
  at done (/Users/kevin/Code/crosscourt-ui/node_modules/roots-browserify/node_modules/browserify/node_modules/module-deps/index.js:229:13)
  at applyTransforms (/Users/kevin/Code/crosscourt-ui/node_modules/roots-browserify/node_modules/browserify/node_modules/module-deps/index.js:199:41)
  at /Users/kevin/Code/crosscourt-ui/node_modules/roots-browserify/node_modules/browserify/node_modules/module-deps/index.js:172:17
  at fs.js:266:14
  at /usr/local/lib/node_modules/roots/node_modules/graceful-fs/graceful-fs.js:104:5
  at Object.oncomplete (fs.js:107:15)

Just to note, that v 3.0.0-rc.5 works without issue.

From playing around with it, it appears that this error occurs when using roots-browserify while compiling .coffee files, here's a snippet of the setup in my app.coffee:

...
extensions: [
  browserify(files: glob.sync("**/assets/js/**/*.coffee"), out: '/js/build.js')
...

and the contents of my application.coffee file:

$             = require 'jquery'
Backbone      = require 'backbone'
Backbone.$    = $
Marionette    = require 'backbone.marionette'
Marionette.$  = $

App = new Marionette.Application()
App.on 'initialize:before', (opts) ->
  ...
App.addRegions
  ...
App.on 'initialize:after', (opts) ->
  if Backbone.history then Backbone.history.start({ pushState: true })
module.exports = App
jescalan commented 10 years ago

Need to see the file that contains the error as well, application.coffee

pruett commented 10 years ago

updated with contents of file in question

jescalan commented 10 years ago

So I have noticed that trying to require javascript files into coffee files are bugging browserify out. If you switch application.coffee to js, just as an experiment, will it pass?

hhsnopek commented 9 years ago

@jenius considering we're on roots v3.0.0-rc10 shall we close this guy?

jescalan commented 9 years ago

Yup