deedubs / require-jade

Add jade to requireJS
MIT License
55 stars 17 forks source link

Throws error when requiring 'path' node module which isn't available on the browser #11

Closed pheuter closed 11 years ago

pheuter commented 11 years ago

parseExtends is requiring 'path' and 'fs' node modules that aren't available in the browser:

parseExtends: function(){
  var path = require('path')
    , fs = require('fs')

This leads to the following error being thrown when attempting to use template inheritance:

Error: fromText eval for csmain failed: Error: failed to require "path"

I've noticed that exports.text uses a variant of require to fetch 'fs':

fs = require.nodeRequire('fs');

But when I try to use nodeRequire, I get the following error:

Object function 'require' has no method 'nodeRequire'

Any ideas? I'm trying to use template inheritance in my jade templates that get compiled by r.js.

DarrellBrogdon commented 11 years ago

I'm seeing this too.

paulyoung commented 11 years ago

@DarrellBrogdon, see #12

DarrellBrogdon commented 11 years ago

Thanks! Looks like client-side Jade isn't yet ready for prime time.

-D

On Feb 28, 2013, at 4:59 PM, Paul Young notifications@github.com wrote:

@DarrellBrogdon, see #12

— Reply to this email directly or view it on GitHub.

pheuter commented 11 years ago

Consider checking out require-j