walmartlabs/thorax — Issue #13: Hello-world example not working
Author: NilsLattek
Created: 2012-01-21 07:27:33+00:00
State: open

I ran into a couple of problems while trying out thorax. Here you can find the steps I took and some of the bugfixes I tried:

Create a new project:

```
npm install -g lumbar thorax
thorax create myProject
cd myProject
lumbar build lumbar.json public
bin/server 8000
```

After opening the browser and navigating to localhost:8000 The first error is: `Cannot GET /`
Ok not a big problem, after looking at the public folder I realized that there is no index.html file in it. So I navigated to localhost:8000/web
This resulted in the following error message in the chrome developer console: `Uncaught ReferenceError: lumbarLoadPrefix is not defined`

I was able to fix this by adding the following line to the index.html file (in the static folder):
``

Reload the browser which resulted in the next error:
`Uncaught ReferenceError: Invalid left-hand side in assignment` in hello-world.js line 1
which is: `Application.hello-world = (function() {`
It turns out that the minus sign is not the best choice here for the module name ;-) So I renamed everything to use an underscore and rebuild the project. (templates/hello_world, styles/hello_world.styl, views/hello_world, routers/hello_world.js)
I also edited lumbar.json, views/hello_world/index.js and routers/hello_world.js and changed hello-world to hello_world.

The next problem is that thorax is not able to find my view:
`Error: view: hello_world/index does not exist.`
I checked the name in js/views/hello_world/index.js which is correct:

Application.View.extend({
name: 'hello_world/index'
});

So I digged into the thorax.js file and it looks like in line 741 the `if (child.name)` is false, because child.name is an empty string and so the view is not added to the Views array.

I stopped looking there for now. Am I missing something? Looks like the hello-world example isn't working or I forgot something during renaming everything.