jasonlewis / basset

A better asset management package for Laravel.

Home Page:http://jasonlewis.me/code/basset

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when compiling CoffeeScript

DavidPhilip opened this issue · comments

Below you'll see what I get as a response when I try to compile my *.coffee files via basset:build. When I run it with coffee command from CLI compilation works.

Here are the 2 scenarios I tested:

WITH COFFEE-SCRIPT MODULE INSTALLED @ APP-ROOT/NODE_MODULES

In this case the build process finishes but coffee-files aren't compiled at all.

WITH GLOBALLY INSTALLED COFFEE-SCRIPT MODULE

Yeah in this case some Assetic-Exception is thrown when the coffee.bin is executed / or read in. I don't know if this is even intended to work :).

  [Assetic\Exception\FilterException]                                                               
  An error occurred while running:                                                                  
  "C:\Program Files (x86)\nodejs\\node.EXE" "C:\Users\Dave\AppData\Roaming\npm\coffee.CMD" "-cp" "  
  C:\Users\Dave\AppData\Local\Temp\ass8C7D.tmp"                                                     

  Error Output:                                                                                     

  C:\Users\Dave\AppData\Roaming\npm\coffee.CMD:1                                                    
  (function (exports, require, module, __filename, __dirname) { @IF EXIST "%~dp0                    
                                                                ^                                   
  SyntaxError: Unexpected token ILLEGAL                                                             
      at Module._compile (module.js:439:25)                                                         
      at Object.Module._extensions..js (module.js:474:10)                                           
      at Module.load (module.js:356:32)                                                             
      at Function.Module._load (module.js:312:12)                                                   
      at Function.Module.runMain (module.js:497:10)                                                 
      at startup (node.js:119:16)                                                                   
      at node.js:901:3                                                                              


  Input:                                                                                            
  $ ->                                                                                              
    $(document).find(".modal[data-show=true]").modal()                                              

I'm not sure if this is an issue because I can't really find anything about a fix so usually this is a good indicator that it's my fault :D. Anyways I'd be grateful if someone or even you @jasonlewis, could help me out here!

Best regards,
David

I was able to fix this by defining the exact path to the coffee executable in my case that was:

$filter->whenAssetIs('.*\.coffee')->setArguments(base_path().'/node_modules/.bin/coffee');