question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Multiple exported component definitions found.

See original GitHub issue

Not sure how to approach this one…

WARNING in ./~/carte-blanche/dist/src/loaders/plugins-loader.js?dest="components"&commonsChunkFilename="undefined"!./src/scripts/components/lib/BrowseHero.jsx
Module build failed: Error: Multiple exported component definitions found.
    at Context.exportDeclaration (/Users/cool-computer/Projects/redacted/node_modules/react-docgen/dist/resolver/findExportedComponentDefinition.js:100:13)
    at Context.invokeVisitorMethod (/Users/cool-computer/Projects/redacted/node_modules/react-docgen/node_modules/ast-types/lib/path-visitor.js:342:43)
    at Visitor.PVp.visitWithoutReset (/Users/cool-computer/Projects/redacted/node_modules/react-docgen/node_modules/ast-types/lib/path-visitor.js:194:28)
    at NodePath.each (/Users/cool-computer/Projects/redacted/node_modules/react-docgen/node_modules/ast-types/lib/path.js:99:22)
    at visitChildren (/Users/cool-computer/Projects/redacted/node_modules/react-docgen/node_modules/ast-types/lib/path-visitor.js:217:14)
    at Visitor.PVp.visitWithoutReset (/Users/cool-computer/Projects/redacted/node_modules/react-docgen/node_modules/ast-types/lib/path-visitor.js:202:16)
    at visitChildren (/Users/cool-computer/Projects/redacted/node_modules/react-docgen/node_modules/ast-types/lib/path-visitor.js:244:21)
    at Visitor.PVp.visitWithoutReset (/Users/cool-computer/Projects/redacted/node_modules/react-docgen/node_modules/ast-types/lib/path-visitor.js:202:16)
    at Visitor.PVp.visit (/Users/cool-computer/Projects/redacted/node_modules/react-docgen/node_modules/ast-types/lib/path-visitor.js:131:25)
    at Object.visit (/Users/cool-computer/Projects/redacted/node_modules/react-docgen/node_modules/ast-types/lib/path-visitor.js:99:51)
 @ ./src/scripts/components/lib !./~/carte-blanche/dist/src/loaders/plugins-loader.js?dest="components"&commonsChunkFilename="undefined"!.*\.jsx$

components declared in webpack config:

new CarteBlanche({
    componentRoot: './src/scripts/components/lib/',
})

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ooricommented, Jul 12, 2016

I experienced the same error, with simpler components following this design:

export class Header extends React.Component {
  render() {
  // ...
  }
}

Header.propTypes = { /* ... */ }

export default Header

The solution was to export only once per file.

0reactions
wmertenscommented, Jan 25, 2017

@cef62 thanks, so basically use require('react-docgen').resolver.findAllComponentDefinitions instead of just the resolver @nikgraf.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React js : how to resolve multiple export? - Stack Overflow
Show activity on this post. Hello i need to have a multiple export in react js but i have this error Line 84:3:...
Read more >
Export multiple components from a file in React.js | bobbyhadz
Use named exports to export multiple components in React, e.g. export function A() {} and export function B() {} . The exported components...
Read more >
Documentation - Modules - TypeScript
Conversely, to consume a variable, function, class, interface, etc. exported from a different module, it has to be imported using one of the...
Read more >
Exporting table data | BigQuery - Google Cloud
For example, if your BigQuery dataset is in the EU multi-region, the Cloud Storage bucket can be located in the europe-west1 Belgium region,...
Read more >
Logix 5000 Controllers Import/Export Project Components
Because of the many variables and requirements associated with any particular installation, Rockwell Automation, Inc. cannot assume responsibility or liability ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found