jhudson8 / smocks

Stateful mock HTTP server using HAPI
MIT License
25 stars 10 forks source link

simple-smocks-server.js example throwing syntax error #13

Closed dpedley closed 8 years ago

dpedley commented 8 years ago

I'm a new user following the first use example steps.

The problem is likely that the simple-smocks-server.js example is out of date.

When hitting http://localhost:8000/_admin I'm getting this syntax error:

started smocks server on 8000.  visit http://localhost:8000/_admin to configure
Debug: internal, implementation, error 
    SyntaxError: unknown: Unexpected token (242:6)
  240 | 
  241 |     return (
> 242 |       <div className="ui secondary pointing menu">
      |       ^
  243 |         <a className="item">
  244 |           Show fixtures by
  245 |         </a>
    at Parser.pp.raise (/Users/dpedley/git/smocks/node_modules/smocks/node_modules/babel-core/node_modules/babylon/index.js:1375:13)
    at Parser.pp.unexpected (/Users/dpedley/git/smocks/node_modules/smocks/node_modules/babel-core/node_modules/babylon/index.js:2813:8)
    at Parser.pp.parseExprAtom (/Users/dpedley/git/smocks/node_modules/smocks/node_modules/babel-core/node_modules/babylon/index.js:747:12)
    at Parser.pp.parseExprSubscripts (/Users/dpedley/git/smocks/node_modules/smocks/node_modules/babel-core/node_modules/babylon/index.js:502:19)
    at Parser.pp.parseMaybeUnary (/Users/dpedley/git/smocks/node_modules/smocks/node_modules/babel-core/node_modules/babylon/index.js:482:19)
    at Parser.pp.parseExprOps (/Users/dpedley/git/smocks/node_modules/smocks/node_modules/babel-core/node_modules/babylon/index.js:413:19)
    at Parser.pp.parseMaybeConditional (/Users/dpedley/git/smocks/node_modules/smocks/node_modules/babel-core/node_modules/babylon/index.js:395:19)
    at Parser.pp.parseMaybeAssign (/Users/dpedley/git/smocks/node_modules/smocks/node_modules/babel-core/node_modules/babylon/index.js:358:19)
    at Parser.pp.parseParenAndDistinguishExpression (/Users/dpedley/git/smocks/node_modules/smocks/node_modules/babel-core/node_modules/babylon/index.js:820:26)
    at Parser.pp.parseExprAtom (/Users/dpedley/git/smocks/node_modules/smocks/node_modules/babel-core/node_modules/babylon/index.js:706:19)
    at Parser.pp.parseExprSubscripts (/Users/dpedley/git/smocks/node_modules/smocks/node_modules/babel-core/node_modules/babylon/index.js:502:19)

Thanks for checking this out.

dpedley commented 8 years ago

I looked a bit deeper and it may have to do with an npm not installed, I think babel-preset-react may provide the correct parsing. Hope this helps!

jhudson8 commented 8 years ago

fixed with 4.0.1. try again and you'll be good

jhudson8 commented 8 years ago

and you were right. thanks!