Doesn't work with require.js #57

Closed
soggie opened this Issue Jul 15, 2012 · 2 comments

Projects

None yet

2 participants

@soggie
soggie commented Jul 15, 2012

I don't think this works with requirejs on the client-side, because require() is redefined here. Trying to require() it with requirejs returns an undefined.

Owner
tj commented Jul 15, 2012

yeah we should do the same as jade and just wrap in a closure and return require('ejs')

soggie commented Jul 16, 2012

That didn't work for me, unfortunately:

(function () {
  // original ejs code

  return require('ejs');
})();

The above script led to requirejs notifying "Uncaught Error: Script Error".

@tj tj closed this in a2b4559 Jul 16, 2012
@TimothyGu TimothyGu added a commit to TimothyGu/ejs-tj that referenced this issue Feb 13, 2015
@TimothyGu TimothyGu Use Buffer.toString() instead of fs.readFileSync()'s second argument
Might fix #57.
ca98d87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment