robinweser/react-layout-components

Instructions on how to run demo?

rhlsthrm opened this issue · 2 comments

I am getting errors when trying to run the demo using npm commands that I reverse-engineered:

$ npm run build:demo                                                                                        11:11:08

> react-layout-components@3.0.3 build:demo /Users/Rahul/Desktop/Axcio/react-layout-components
> npm run build && browserify -t babelify demo/app.jsx --outfile demo/bundle.js


> react-layout-components@3.0.3 build /Users/Rahul/Desktop/Axcio/react-layout-components
> babel modules/ --out-dir lib/

modules/components/Box.jsx -> lib/components/Box.js
modules/components/Container.jsx -> lib/components/Container.js
SyntaxError: modules/components/Page.jsx: Unexpected token (3:15)
  1 | import React from 'react'
  2 |
> 3 | export default const Page = ({ style, children }) => (
    |                ^
  4 |   <div style={{ ...styles, ...style }}>
  5 |     {children}
  6 |   </div>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
....

I'm not even sure I am running the correct commands.

Not familiar with this project (I just stumbled here via Twitter) but from what I can tell this might be on your end. Is modules/components/Page.jsx your file? If so what happens if you make line 3 be just const Page = and then do export default Page later. You cannot use const on the same line as your export default

@willmanduffy actually modules/components/Page.jsx is not my file, it is part of the library. However, I made the change you suggested and that fixed the issue. Thanks for the help, I'll submit a PR for it.