Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

"Duplicate export 'default'" when only module.exports.default is defined #209

Closed
AndrewKvalheim opened this issue Jul 14, 2017 · 4 comments

Comments

@AndrewKvalheim
Copy link

Not very familiar with JS tooling so apologies if this is obvious. I think I'm still seeing a variant of #158.

Test case:

// test/function/duplicate-default-exports-only-default/x.js

module.exports.default = 42;
// test/function/duplicate-default-exports-only-default/main.js

import x from './x';
$ yarn test
[...]
  61 passing (537ms)
  1 failing

  1) rollup-plugin-commonjs function duplicate-default-exports-only-default:
     Error: Duplicate export 'default'
      at error (node_modules/rollup/src/utils/error.js:2:14)
      at Module.error$1 [as error] (node_modules/rollup/src/Module.js:303:2)
      at tryParse (node_modules/rollup/src/Module.js:27:10)
      at new Module (node_modules/rollup/src/Module.js:53:15)
      at node_modules/rollup/src/Bundle.js:301:20
      at <anonymous>
[...]

In the wild: cheerio 1.0.0-rc.2 at lib/options.js

@bjrnt
Copy link

bjrnt commented Jul 31, 2017

I'm having this issue as well. Did you find any solution?

@AndrewKvalheim
Copy link
Author

No, I didn't pursue this any further; just opted not to use Rollup for this project.

@futurist
Copy link

Any update for this? that is very common error when using rollup, with this issue, and cannot be resolved?

@shellscape
Copy link
Contributor

Hey folks (this is a canned reply, but we mean it!). Thanks to everyone who participated in this issue. We're getting ready to move this plugin to a new home at https://github.com/rollup/plugins, and we have to do some spring cleaning of the issues to make that happen. We're going to close this one, but it doesn't mean that it's not still valid. We've got some time yet before the move while we resolve pending Pull Requests, so if this issue is still relevant, please @ me and I'll make sure it gets transferred to the new repo. 🍺

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

No branches or pull requests

4 participants