Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requiring relative coffeescript files does not work, even with coffeeify installed #70

Closed
oveddan opened this issue Dec 19, 2014 · 3 comments

Comments

@oveddan
Copy link

oveddan commented Dec 19, 2014

When trying to include coffeescript files from other coffeescript files when using coffeeify with karma-browserify, I get an error:

karma start karma.conf.js

Uncaught Error: Cannot find module '/Users/doved/source/app/test/config.coffee'

This is my directory structure:

test
----app_test.coffee
----config.coffee
----something.js

My karma config looks like:

module.exports = function(karma) {
  karma.set({
    frameworks: [ 'browserify', 'mocha' ],
    files: ['test/**/*.coffee', 'test/**/*.js'],
    preprocessors: {
      'test/**/*.coffee': [ 'browserify' ]
    },

    browserify: {
      debug: true,
      transform: [ 'coffeeify' ],
      extensions: [ ".coffee"]
    }
  });
}

In app_test.coffee:

something = require('./something')
config = require('./config')

I'm only getting an error when including the config.coffee file, and not when including the something.js file.

Running browserify from the shell works without an error:

browserify -t coffeeify --extension=".coffee" test/app_test.coffee
@nikku
Copy link
Owner

nikku commented Dec 19, 2014

You are including the config.coffee from the test/app_test.coffee? You may have ran into #52 then.

@oveddan
Copy link
Author

oveddan commented Dec 19, 2014

@nikku Yes, that's what I'm doing. When I require something.js from test/app_test.coffee, the issue doesn't happen.

@bendrucker
Copy link
Collaborator

That's #52 then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants