Search code examples
cloud9-ide

Can't run demo site in Cloud9


I'm trying to start using cloud9. I created the following html file:

<html>
    <body>
        <h1>Hello</h1>
    </body>
</html>

When I try to run, I get

ReferenceError: document is not defined
    at Object.<anonymous> (/home/ubuntu/workspace/html/js/site.js:1:63)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain [as _onTimeout] (module.js:497:10)
    at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)

Solution

  • It looks like you are running site.js in Node.js instead of your html file in apache.