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

  • Home
  • SEARCH
  • 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 7553957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:12:21+00:00 2026-05-30T11:12:21+00:00

Context I cloned a basic node-browserify boilerplate project and got it up. I’m using

  • 0

Context

I cloned a basic node-browserify boilerplate project and got it up. I’m using coffee-script. Right now, I’m trying to add jadeify to the equation as follows:

bundle = browserify
    entry: __dirname + "/app/init.coffee"
    debug: true
    mount: "/app.js"
bundle.use jadeify __dirname + '/views'
app.use bundle

This is before I even attempt to use jadeify anywhere.

Issue

Everything works, until I add bundle.use(jadeify(__dirname + '/views')) as a middleware to browserify. Then I get the following error message in browser’s console:

Uncaught ReferenceError: __require is not defined

According to the browser’s console, the source of this message is /app.js.

Question

Why does this script fail with an error as soon as I try to add the jadeify middleware for browserify?

Motivation

I figured that it’ll be more convenient to reuse server-side jade templates on client-side, so I’m ditching underscore templates in favor of jade. While doing my research, I came across this solution to a related question that suggests the use of jadeify. It seems doable, but something seems to be failing.

  • 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-05-30T11:12:22+00:00Added an answer on May 30, 2026 at 11:12 am

    One can bypass jadeify by using browjadify

    Usage:
       browjadify --entry=app.coffee >bundle.js
    

    Source: browjadify

    #!/usr/bin/env node
    
    var jade = require('jade')
    var browserify = require('browserify')
    var fs      = require('fs');
    var argv = require("optimist").argv;
    
    var b = browserify()
    
    b.register('.jade', function(body) {
        var options = {"client": true, "compileDebug": false};
        body = "module.exports = " + jade.compile(body, options).toString() +";";
        return body;
    });
    
    var jaderuntime = require('fs').readFileSync(__dirname+"/node_modules/jade/runtime.js", 'utf8');
    b.prepend(jaderuntime); // Brings in var jade that jade.compile needs
    
    b.addEntry(argv.entry); // gets browserify to do its thing
    
    console.log(b.bundle()); // the bundled output
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Context: HTML widgets generated using a Django ModelForm and template, jQuery 1.3.2, JavaScript on
I'm trying to understand some fundamental best practices using Entity Framework. My EDM design
I'm having a problem trying to add an object to an object context in
Just cloned the basic_project and trying to customize by following this - http://pinaxproject.com/docs/0.7/tabs/#ref-tabs Created
I retrieve an object graph from DB using EF4. The context is closed as
I'm using GIT to manage a Content Management System (CMS) project. The CMS can
I've got a relatively basic scenario where I've got a nav HTML element that
I have been using both git and svn for quite some time now, and
If context menu is added to jqGrid using Custom values to Context Menu Items
I have a very basic webservice using WCF (C#, .NET 4.0), to return an

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.