require-jade icon indicating copy to clipboard operation
require-jade copied to clipboard

Uncaught Error: failed to require "fs"

Open mildfuzz opened this issue 10 years ago • 5 comments

Getting Uncaught Error: failed to require "fs" when I try to include a jade template:

require.config({
    baseUrl: '/',
    paths: {
        'jade': 'require-jade/jade'
    }
});

require(['jade!contact'], function(contact) {
});

Template is being served by an express.js server.

mildfuzz avatar May 15 '14 08:05 mildfuzz

I guess you have either extends either include in your template. These features are not currently supported by this plugin.

crissdev avatar May 15 '14 08:05 crissdev

I do have extends. Okay, I can refactor my templates to not use this functionality, but do we know what are the blockers to adding this support to the plugin?

mildfuzz avatar May 15 '14 09:05 mildfuzz

@mildfuzz To be honest, I tried to have this feature but it turned out to be more complicated than I thought. Since I am working with Webstorm it was easy for me to setup a file watcher and generate the HTML for any JADE in the project. Since you won't publish your JADE files to your production server (I guess) you could do the same or use this Grunt plugin.

Please have in mind that the plugin is using Jave v0.30.0 - the latest version of Jade is 1.3.1

crissdev avatar May 15 '14 09:05 crissdev

So should now be considered 'unsupported'?— Sent from Mailbox

On Thu, May 15, 2014 at 10:10 AM, Cristian Trifan [email protected] wrote:

@mildfuzz To be honest, I tried to have this feature but it turned out to be more complicated than I thought. Since I am working with Webstorm it was easy for me to setup a file watcher and generate the HTML for any JADE in the project. Since you won't publish your JADE files to your production server (I guess) you could do the same or use this Grunt plugin.

Please have in mind that the plugin is using Jave v0.30.0 - the latest version of Jade is 1.3.1

Reply to this email directly or view it on GitHub: https://github.com/deedubs/require-jade/issues/30#issuecomment-43185701

mildfuzz avatar May 15 '14 09:05 mildfuzz

Well I'm not the one to say this...but this shouldn't be a stopper for your project. There is this fork that might have what you're looking for.

crissdev avatar May 15 '14 09:05 crissdev