Skip to content

Instantly share code, notes, and snippets.

@aaronj1335
Created August 22, 2012 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aaronj1335/3429734 to your computer and use it in GitHub Desktop.
Save aaronj1335/3429734 to your computer and use it in GitHub Desktop.
bootstrapping mr
<!doctype html>
<html>
<head>
<script src="node_modules/mr/bootstrap.js" data-module=index></script>
</head>
</html>
var underscoreRet = require('underscore');
var d = document.createElement('div');
d.innerHTML = 'module ' + module.location + ' loaded';
var _ = window._;
console.log();
d.innerHTML += '<br />underscore ' + _.version + ' loaded';
document.body.appendChild(d);
{
"name": "Ω",
"version": "0.0.0",
"description": "ERROR: No README.md file found!",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": "",
"author": "",
"license": "BSD",
"dependencies": {
"mr": ">=0.0.2",
"underscore": ">=1.3.3"
}
}
@aaronj1335
Copy link
Author

this should serve up an mr module and print 'hello world' to the screen, but it doesn't seem to work.

steps to reproduce

  • copy and paste the following into a terminal (you'll need to replace the 'open' call if you're not on os x):

    git clone git@gist.github.com:3429734.git gist-3429734
    cd gist-3429734
    npm install mr
    ( python -m SimpleHTTPServer & ) && sleep 1 && open http://localhost:8000
    
  • check the the javascript console for "Hello, World!"

expected behavior

  • the module should load and print the phrase

actual behavior

  • the index.js module is never loaded

also note

i tried kicking off the python -m SimpleHTTPServer in the demo folder of the mr project, and it worked correctly, but i want to start playing with my own project :) (and installing dependencies via npm).

what's wrong?

@kriskowal
Copy link

Looking into it. Looks good to me.

@kriskowal
Copy link

Reproduced the error. Isolating.

@kriskowal
Copy link

Got it. It’s because of a customization in Q that is getting trampled by NPM. I’ll move things around.

@kriskowal
Copy link

Published v0.0.2 to address this. Works locally now. Thanks for the reduction.

@aaronj1335
Copy link
Author

hey yo! thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment