Closed vanesterik closed 11 years ago
Hi do you have an example of your project I can run to debug? Preferably a pared down one showing the problem
You'll have to excuse and I'm probably gonna embarras myself on my noob level.
But this is what I did..:
First I created a new eco template (filename: Header.eco) in the app/views directory with the following markup..:
<p>Hello world</p>
Than I created a new controller (filename: Header.coffee) with the following code..:
class Header extends Spine.Controller
constructor: ->
super
@html require( 'views/Header' )
module.exports = Header
And append this controller in the application.coffee file with the following code..:
Header = require( 'controllers/Header' )
class App extends Spine.Controller
constructor: ->
super
@header = new Header
@append @header
module.exports = App
Now when I view the website in Chrome with the Brunch localhost link http://localhost:3333/ - I get the following error message in the console..:
Uncaught Error: Cannot find module "views/Header" - common.js:61
I really like the structure of this repo and definitely want to start learning by getting familiar with this modules. But this issue is really getting to me and I would really appreciate any pointers you can give me.
Thanks in advance
Okay - it's official - I'm a total idiot.
I was just trying to make it work and started to scrutinize the codebase. Comparing other skeletons in how they were build up - apparently the config.coffee file wasn't totally in-sync with other examples I saw. Especially the 'templates' codeblock which was indented a little different than others. Just aligning it with the codeblocks above made it work..: YIHAA
Thanks for your efforts to help me out - and next time I will go a little bit further before crying for help..;)
Hi,
I'm totally new at pre-compiling HTML5 app's and am hopefully getting better every moment. Feels a little silly and I'm sure you guys know what I'm doing wrong. But I got stuck at the require a eco-template bit. It seems CommonJS doesn't want to read or find eco templates. Does anybody know what I'm doing wrong..?
Love to hear from you, Koen