joyent/node — Issue #1974: Proper modules.exports missing?
Author: mephistho
Created: 2011-10-31 14:05:16+00:00
State: open

Hi there,

I want to use LeaftletJS (http://leaflet.cloudmade.com/) server-sided with nodejs. But node is always giving me a "L is not defined". Together with the developer of leaflet I figured out, it is an issue of exporting the root-L-object of leaflet as a module.
Find the related leaflet-issue here: https://github.com/CloudMade/Leaflet/issues/356

Do we miss something? What is required in this case of using an "root.L" to export this a module?

Calling "var L = require('./leafletjs/dist/leaflet.js');" immediately fails with this message:

$ node html5webclient/leafletnode.js
exporting L

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
ReferenceError: L is not defined
at Object. (/cygdrive/c/path/to/leafletjs/dist/leaflet.js
:6:463)
at Module._compile (module.js:411:26)
at Object..js (module.js:417:10)
at Module.load (module.js:343:31)
at Function._load (module.js:302:12)
at require (module.js:355:19)
at Object. (/cygdrive/c/path/to/leafletnode.js:28:15)
at Module._compile (module.js:411:26)
at Object..js (module.js:417:10)
at Module.load (module.js:343:31)

Would be grateful for any hint or suggestions as this is getting a bit time-critical for my Bachelor-Thesis soon.

Many thanks in advance,
Andreas