cli icon indicating copy to clipboard operation
cli copied to clipboard

Serve command not rendering marko templates

Open haikyuu opened this issue 4 years ago • 1 comments

I copy pasted the example of the home page of marko, but it didn't work. The command I use is npx @marko/serve . or npx @marko/serve index.marko.

class {
  onCreate() {
    this.state = { count: 0 };
  }
  increment() {
    this.state.count++;
  }
}

style {
  .count {
    color: #09c;
    font-size: 3em;
  }
  .example-button {
    font-size: 1em;
    padding: 0.5em;
  }
}

<div.count>
  ${state.count}
</div>
<button.example-button on-click("increment")>
  Click me!
</button>

Also, consize syntax doesn't work: a simple template like h1 -- hello wouldn't work either.

haikyuu avatar Feb 03 '21 20:02 haikyuu

It works fine when you install @marko/serve as an npm package and run marko-serve

haikyuu avatar Feb 05 '21 09:02 haikyuu