react-spinners: 0.5.13 Multiple default exports crashing meteor and babel minifier

Describe the bug

Error within UI after successful build: Screen Shot 2019-07-23 at 11 17 57 AM Screen Shot 2019-07-23 at 11 17 46 AM

Error thrown during babel minification process in meteor:

 
export default Component; 
 
at maybeThrowMinifyErrorBySourceFile 
(packages/minifyStdJS/plugin/minify-js.js:96:26) 
at files.forEach.file (packages/minifyStdJS/plugin/minify-js.js:135:9) 
at Array.forEach (<anonymous>) 
at MeteorBabelMinifier.processFilesForBundle 
(packages/minifyStdJS/plugin/minify-js.js:118:9) 
 
 
While minifying app code: 
packages/minifyStdJS/plugin/minify-js.js:96:26: Babili minification error 
within packages/modules.js: 
node_modules/react-spinners/dist/BeatLoader.js 
 
Only one default export allowed per module.: 
 
export default Component; 
 
at maybeThrowMinifyErrorBySourceFile 
(packages/minifyStdJS/plugin/minify-js.js:96:26) 
at files.forEach.file (packages/minifyStdJS/plugin/minify-js.js:135:9) 
at Array.forEach (<anonymous>) 
at MeteorBabelMinifier.processFilesForBundle 
(packages/minifyStdJS/plugin/minify-js.js:118:9)

To Reproduce Steps to reproduce the behavior:

  1. Meteor app using version 1.8.1. Babel runtime 7.3.4.
  2. Import react-spinner 0.5.13 into app and throws errors shown in screenshot.

Temporary Solution Our solution was to downgrade to version 0.5.12 until this is resolved.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 16 (9 by maintainers)

Commits related to this issue

Most upvoted comments

ok, 0.5.13 is deprecated. tagged 0.5.12 as latest.

@davidhu2000 importing like import GridLoader from 'react-spinners/GridLoader'; seems to work for me

this is so weird. these are the only changes for 0.5.13

https://github.com/davidhu2000/react-spinners/commit/53e943b40cff57a607e17268e986011c6cf4d93b

https://github.com/davidhu2000/react-spinners/commit/a51b9722e655e24c8e8ed7cec9828ae2edb4e88e

https://github.com/davidhu2000/react-spinners/commit/93ca51c9e57fe0a62aef64696f8fa9aa10592587

No idea how these commits are causing this issue.

Can you try to import like this and see if the issue persists?

import GridLoader from 'react-spinners/GridLoader';

Yes downgrading fixes the issue completely, our diff for the fix:

-    "react-spinners": "^0.5.4",
+    "react-spinners": "0.5.12",

^0.5.4 was defaulting to 0.5.13 when building from scratch. Locally I have switched back and forth between 0.5.12 and 0.5.13 and replicated the problem. Only 0.5.13 has a problem.

I also get the same issue with 0.6.0-alpha.1.