Trying to define an asset compiler in Compoundjs and getting undefined method error

g0dl1ke

New Member
I'm trying to define an asset compiler http://compoundjs.com/docs/#asset-compiler-adding-your-own-compiler, however, I keep getting an error:\[code\]app.use(compound.assetsCompiler.add('scss', { ^TypeError: Cannot call method 'add' of undefined\[/code\]My entire \[code\]environment.js\[/code\] file looks like:\[code\]module.exports = function (compound) { var express = require('express'); var app = compound.app; app.configure(function (){ app.use(compound.assetsCompiler.add('scss', { render: function (str, options, fn) { try { fn(null, @scss.render(str)); } catch (err) { fn(err); } }, scss: require('node-sass'), sourceExtension: 'scss', destExtension: 'css' }).init()); app.use(express.static(app.root + '/public', { maxAge: 86400000 })); app.set('jsDirectory', '/javascripts/'); app.set('cssDirectory', '/stylesheets/'); app.set('cssEngine', 'scss'); app.use(express.bodyParser()); app.use(express.cookieParser('secret')); app.use(express.session({secret: 'secret'})); app.use(express.methodOverride()); app.use(app.router); }); };\[/code\]I tried a \[code\]console.log(compound.assetsCompiler);\[/code\] just before the \[code\]app.use(compount.assetsCompiler...\[/code\] statement and sure enough I get \[code\]undefined\[/code\]. The documentation also says to use \[code\]compound.assetCompiler.add(...);\[/code\] (singular asset) which I assume is a typo but since it got that typo wrong multiple times I tried it as well but had the same problem. Does anyone have any idea how to fix this?
 
Back
Top