rollup / rollup/rollup

Warning about mixing default and named exports with commonjs plugin

Open
#3,368 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
26.3k
Forks
1.8k
Avg merge
2d 11h
Merged PRs (30d)
20

Description

  • Rollup Version: 1.31.0
  • Operating System (or Browser): Ubuntu 18.04.3 LTS
  • Node Version: 13.7.0
How Do We Reproduce?

Open this repo and run the bootstrap commands specified in README.md

Please also take a look at original-project-commonjs.output.js. I don't know what this invocation means there

export default commonjsHelpers.unwrapExports(main);

In my minimum reproduction commonjs.output.js file there is no unwrapExports(), however the warning is still left

Expected Behavior

No warnings

Actual Behavior

I get the following warning:

~/my/junk/rollup (master) $ npx rollup -c

./main.js → ./main.bundle.js...
(!) Mixing named and default exports
https://rollupjs.org/guide/en/#output-exports
The following entry modules are using named and default exports together:
main.js

Consumers of your bundle will have to use chunk['default'] to access their default export, which may not be what you want. Use `output.exports: 'named'` to disable this warning
created ./main.bundle.js in 30ms
~/my/junk/rollup (master) $ 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction repository and follow the bootstrap commands in README.md, then run the Rollup command described in the issue. Compare original-project-commonjs.output.js with commonjs.output.js and inspect main.js to trace the mixed export warning. Done means the reproduction behavior is understood and the reported warning is corrected or clearly characterized.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.