meteorhacks / meteor-ssr

Server Side Rendering for Meteor
https://atmospherejs.com/meteorhacks/ssr
264 stars 30 forks source link

Using < operator in .html file, 'Expected tag name after ...' #33

Open HunjaeJung opened 9 years ago

HunjaeJung commented 9 years ago

Server Side

SSR.compileTemplate('hello', Assets.getText('hello.html'));

private/hello.html

<head>
  <script type="text/javascript">
     if(1<2) console.log('hello SSR');
  </script> 
</head>
<body>
...
</body>
Error: Expected tag name after `<` ...avascript"> if(1<2) console.log('hell... ^ at [object Object].Scanner.fatal (packages/html-tools/scanner.js:45:1) at HTMLTools.Parse.getTagToken (packages/html-tools/tokenize.js:373:1) at HTMLTools.Parse.getHTMLToken (packages/html-tools/tokenize.js:274:1) at HTMLTools.Parse.getContent (packages/html-tools/parse.js:110:1) at HTMLTools.Parse.getContent (packages/html-tools/parse.js:174:1) at HTMLTools.Parse.getContent (packages/html-tools/parse.js:174:1) at HTMLTools.Parse.getContent (packages/html-tools/parse.js:174:1) at Object.HTMLTools.parseFragment (packages/html-tools/parse.js:36:1) at Object.SpacebarsCompiler.parse (packages/spacebars-compiler/compiler.js:4:1) at Object.SpacebarsCompiler.compile (packages/spacebars-compiler/compiler.js:12:1)

I think this is the problem, right?

HunjaeJung commented 9 years ago

What is the best way to server side rendering javascript?