Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple "export default" statements in ProductDetail.jsx #35

Open
steveliles opened this issue Nov 24, 2016 · 0 comments
Open

Multiple "export default" statements in ProductDetail.jsx #35

steveliles opened this issue Nov 24, 2016 · 0 comments

Comments

@steveliles
Copy link

With Node 6.9.1 & npm 3.10.8:

git clone [email protected]:coodoo/react-redux-isomorphic-example.git
npm i
npm start

gives:

> [email protected] start /Users/steve/dev/kv/node/qna/react-redux-isomorphic-example
> node server/index.js

/Users/steve/dev/kv/node/qna/react-redux-isomorphic-example/node_modules/babel-core/lib/transformation/file/index.js:600
      throw err;
      ^

SyntaxError: /Users/steve/dev/kv/node/qna/react-redux-isomorphic-example/common/components/ProductDetail.jsx: Only one default export allowed per module. (60:0)
  58 | // refer from using decorator before it became a standarized
  59 | // @connect( (state, ownProps) => { products: state.products } )
> 60 | export default connect( (state, ownProps) => ({ products: state.products }) )(ProductDetail)
     | ^
  61 | 
    at Parser.pp$5.raise (/Users/steve/dev/kv/node/qna/react-redux-isomorphic-example/node_modules/babylon/lib/index.js:4246:13)
    at Parser.pp$1.raiseDuplicateExportError (/Users/steve/dev/kv/node/qna/react-redux-isomorphic-example/node_modules/babylon/lib/index.js:2666:8)
    at Parser.pp$1.checkDuplicateExports (/Users/steve/dev/kv/node/qna/react-redux-isomorphic-example/node_modules/babylon/lib/index.js:2660:10)
    at Parser.pp$1.checkExport (/Users/steve/dev/kv/node/qna/react-redux-isomorphic-example/node_modules/babylon/lib/index.js:2559:12)
    at Parser.pp$1.parseExport (/Users/steve/dev/kv/node/qna/react-redux-isomorphic-example/node_modules/babylon/lib/index.js:2496:10)
    at Parser.parseExport (/Users/steve/dev/kv/node/qna/react-redux-isomorphic-example/node_modules/babylon/lib/index.js:5296:20)
    at Parser.pp$1.parseStatement (/Users/steve/dev/kv/node/qna/react-redux-isomorphic-example/node_modules/babylon/lib/index.js:1752:74)
    at Parser.parseStatement (/Users/steve/dev/kv/node/qna/react-redux-isomorphic-example/node_modules/babylon/lib/index.js:5218:22)
    at Parser.pp$1.parseBlockBody (/Users/steve/dev/kv/node/qna/react-redux-isomorphic-example/node_modules/babylon/lib/index.js:2133:21)
    at Parser.pp$1.parseTopLevel (/Users/steve/dev/kv/node/qna/react-redux-isomorphic-example/node_modules/babylon/lib/index.js:1645:8)

easy fix:

remove export default from line 8 of ProductDetail.jsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant