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

Error: failed to require "undefined" from undefined #23

Closed
jeffwillden opened this issue Nov 15, 2013 · 1 comment
Closed

Error: failed to require "undefined" from undefined #23

jeffwillden opened this issue Nov 15, 2013 · 1 comment

Comments

@jeffwillden
Copy link

I'm considering gluejs for a project, rendering to an express/connect response. The 2nd-to-the-last line in the resulting file has myModuleName = require('undefined'); but all the other scripts appear to concatenated in there fine. What am I missing?

app.get('/js/model.js', function(req, res) {
    new Glue()
        .basepath('./model')
        .include('./')
        .export('myModuleName')
        .render(function(err, js) {
            res.setHeader('content-type', 'application/javascript');
            res.send(js);
        });
});
@mixu
Copy link
Owner

mixu commented Nov 15, 2013

You need to set the main file explicitly, for example: .main('model.js'). This is the file that's going to be the root of the package.

I noticed this was missing from the docs snippet so I'll update it, thanks for reporting!

Edit: .main('model.js')

@mixu mixu closed this as completed in 4f9919d Nov 15, 2013
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

2 participants