0

I'm getting an error that doesn't really make much sense. This is the part of my Cakefile that does the coffee compilation:

buildsrc: ->
    stitch = require 'stitch'
    fs = require 'fs'

    # Create stitch package
    pkg = stitch.createPackage
        paths: [__dirname + '/src']
        dependencies: [
            __dirname + '/vendor/jquery-1.7.1.min.js'
            __dirname + '/vendor/jquery-ui-1.8.18.min.js'
            __dirname + '/vendor/jquery.cookie.js'
            __dirname + '/vendor/jquery.iframe-transport.js'
            __dirname + '/vendor/jquery.fileupload.js'
        ]

    # Compile the package
    pkg.compile (err, src)->
        if err
            console.warn 'Coffee compile failed:'
            console.warn err.toString()
        else
            # Save the source code
            fs.writeFile BUILD_JS_PATH, src, (err)->
                if err then throw err
                console.log 'Compiled src to ' + BUILD_JS_PATH

And the output from running that (shortened path):

Coffee compile failed:
Error: C:\Users\Codemonkey\...\project\src\foo.coffee isn't in the require path

This worked wonderfully on Linux with the same code and the same node-, stitch- and coffee-script versions. I can see that the error is thrown in stitch.coffee:177, but I can't figure out what it means, if it's my fault or how to fix it.

Thanks for your help!

Hubro
  • 56,214
  • 69
  • 228
  • 381

1 Answers1

1

Yeah it was a directory separator issue with Windows - I found an un-pulled pull-request that fixes the issue - https://github.com/sstephenson/stitch/pull/34

Hubro
  • 56,214
  • 69
  • 228
  • 381