socketstream / ss-jade

Jade (HTML) code wrapper for SocketStream 0.3
10 stars 2 forks source link

node_modules/jade/index.js bad require? #1

Closed OClement closed 10 years ago

OClement commented 12 years ago

Using ss-jade like so (app.js) : ss.client.formatters.add(require('ss-jade'));

Yields this error open launching the app:

Error: Cannot find module './lib/jade'
    at Function._resolveFilename (module.js:332:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at Object.<anonymous> (c:\Node\bia\node_modules\ss-jade\node_modules\jade\index.js:4:5)

Referring to:

module.exports = process.env.JADE_COV
  ? require('./lib-cov/jade')
  : require('./lib/jade');

Shouldn't it be ... : require('jade'); ?

Not sure what JADE_COV is or what it reffers to, might need modifications as well.

Actually I'm not sure this issue is directly related to ss-jade, but since jade was working fine for me in express without using socketstream...

OClement commented 12 years ago

Correction:

using require('jade') would load a browser version if I understand correctly, as it contains a ref to the window object.

The correct file to load is actually require('./lib/index')

For some reason, when comparing a normal installation of Jade through NPM, the target file is indeed ./lib/jade.js while the version packaged with ss-jade still refers to the same path, but ./lib/jade.js was renamed to ./lib/index.js

paulbjensen commented 10 years ago

Hi,

Apologies for the long time before responding. Is this issue still occurring today?

Regards,

Paul Jensen

OClement commented 10 years ago

Hi Thanks for taking the time to respond despite the long delay Unfortunately I wouldn't be able to tell; I changed my mind over a few things and ended up not using this I haven't tried this since that time, sorry!

paulbjensen commented 10 years ago

Hi,

No worries. I'll mark this issue as closed for now, as I haven't been able to replicate it. If it occurs again, I'll be on hand to fix it.