fuse-box/react-example

"SyntaxError: unknown: Unexpected token" on fresh install

ugogo opened this issue · 7 comments

ugogo commented

Hi, I cloned this example in order get started with FuseBox, but I got this issue when trying to node fuse.js

Am I missing something?

Here are the logs

20:11:59 : Launching dev server on port 4444
{ SyntaxError: unknown: Unexpected token (8:2)
  6 |
  7 | ReactDOM.render(
> 8 |   <App />, document.getElementById('root'));
    |   ^
  9 |
    at Parser.pp$5.raise (/Users/ugo/dev/qollect/node_modules/babylon/lib/index.js:4373:13)
    at Parser.pp.unexpected (/Users/ugo/dev/qollect/node_modules/babylon/lib/index.js:1716:8)
    at Parser.pp$3.parseExprAtom (/Users/ugo/dev/qollect/node_modules/babylon/lib/index.js:3683:12)
    at Parser.pp$3.parseExprSubscripts (/Users/ugo/dev/qollect/node_modules/babylon/lib/index.js:3427:19)
    at Parser.pp$3.parseMaybeUnary (/Users/ugo/dev/qollect/node_modules/babylon/lib/index.js:3407:19)
    at Parser.pp$3.parseExprOps (/Users/ugo/dev/qollect/node_modules/babylon/lib/index.js:3337:19)
    at Parser.pp$3.parseMaybeConditional (/Users/ugo/dev/qollect/node_modules/babylon/lib/index.js:3314:19)
    at Parser.pp$3.parseMaybeAssign (/Users/ugo/dev/qollect/node_modules/babylon/lib/index.js:3277:19)
    at Parser.pp$3.parseExprListItem (/Users/ugo/dev/qollect/node_modules/babylon/lib/index.js:4231:16)
    at Parser.pp$3.parseCallExpressionArguments (/Users/ugo/dev/qollect/node_modules/babylon/lib/index.js:3506:20)
  pos: 133,
  loc: Position { line: 8, column: 2 },
  _babel: true,
  codeFrame: '\u001b[0m \u001b[90m 6 | \u001b[39m\n \u001b[90m 7 | \u001b[39m\u001b[33mReactDOM\u001b[39m\u001b[33m.\u001b[39mrender(\n\u001b[31m\u001b[1m>\u001b[22m\u001b[39m\u001b[90m 8 | \u001b[39m  \u001b[33m<\u001b[39m\u001b[33mApp\u001b[39m \u001b[33m/\u001b[39m\u001b[33m>\u001b[39m\u001b[33m,\u001b[39m document\u001b[33m.\u001b[39mgetElementById(\u001b[32m\'root\'\u001b[39m))\u001b[33m;\u001b[39m\n \u001b[90m   | \u001b[39m  \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\n \u001b[90m 9 | \u001b[39m\u001b[0m' }
└── default (5 files,  4.5 kB)
      index.jsx
      App.jsx
      App.css
      logo.svg
      index.css

    Bundle
    Size: 4.5 kB
    Time: 353ms

Thanks

Hi!
I just did a fresh install and it works like a charm.

What nodejs version are you using? Are you sure that all dependencies were installed correctly?

ugogo commented

Everything looks fine 😕


Node version

$ node-v
v7.2.0

Yarn install

$ yarn install
yarn install v0.20.3
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
✨  Done in 10.29s.

Could you clone it once again?

There has been a tiny error in fuse.js, but it's barely related to your issue. Anyway, clone it now, and see if it helps

ugogo commented

That's weird.
It works fine on a fresh clone, but after copy/paste files into another folder (and running yarn install ofc), the same error happens again

Right. When you copy paste, you leave .babelrc file behind which is required. Make sure you copy paste all hidden files.

That's more than clear.

ugogo commented

Hah, make sense.
Thanks!