Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8870617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:46:52+00:00 2026-06-14T17:46:52+00:00

Just started playing with Grunt and would like to use Stitch to combine my

  • 0

Just started playing with Grunt and would like to use Stitch to combine my modules for the use on the client side. I don’t have much experience with commonJS in general and both libaries are new to me — so please bear with me.

Here’s an excerpt from my Grunt file:

var fs     = require('fs');
var stitch = require('stitch');

module.exports = function(grunt) {

  grunt.initConfig({

    … SNIP …

    stitch: {
      dist: {
        src: ['lib'],
        dest: 'dist/<%= pkg.name %>.js'
      }
    }
  });


  grunt.registerMultiTask('stitch', 'Compile common.js modules with stitch', function() {
    var done = this.async();

    var paths = this.file.src.map(function(dir){
      return __dirname + '/' + dir;
    });

    stitch.createPackage({ paths: paths }).compile(function(error, src){
      if (error) {
        return grunt.log.writeln(error);
      }
      file.write(name, src);
      grunt.log.writeln("File '" + name + "' created.");
      done();
    });
  });

};

When running grunt stitch however, I’m getting:

ReferenceError: can't compile  /path/to/file.js
file is not defined

The absolute path is correct, though, and the file does exist.

Any advice would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:46:54+00:00Added an answer on June 14, 2026 at 5:46 pm

    It turns out that a reference within one of the files I’m trying to combine was incorrect.

    This question should probably be closed as too localized, but in the unlikely case someone might have the same problem — check all require calls and see if they point to the correct file. Remember that the path will be relative to the root not the requiring file.

    However, this error message in particular is very cryptic and basically useless IMO.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just started playing with Eclipse RCP. A few things that I would like
i have just started playing aorund with asp.net mvc and i want to view
I just started playing with scala and have been using the Scala By Example
I've just started playing with Castle active record as it seems like a gentle
I just started playing with memcache(d) last night so I have a LOT to
I´ve just started playing around with Java and Hibernate and have gotten an application
I just started playing around with knockout and I have a question. Here's part
I have just started playing with TeamCity and its great. Now I got it
I'm just started playing with Tweepy and have it installed. I've done basic oauth
I'm new to cmake and have just started playing around with it. My problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.