React-virtualized: Duplicate declaration "bpfrpt_prototype_Scroll"

Created on 31 Jan 2018  路  10Comments  路  Source: bvaughn/react-virtualized

Reporting a Bug?

The built es version of https://unpkg.com/[email protected]/dist/es/List/List.js has a duplicate declaration of a named import. You can see it at the bottom of the file:

import { bpfrpt_proptype_Scroll } from '../Grid';
// ...
import { bpfrpt_proptype_Scroll } from './types';

Found this gives me an error in storybook/webpack:

info @storybook/react v3.3.11
info 
info => Loading custom .babelrc
info => Loading custom addons config.
info => Using default webpack setup based on "Create React App".
info Building storybook ...
ERR! Failed to build the storybook
ERR! ./stories/node_modules/react-virtualized/dist/es/List/List.js
ERR! Module build failed: Duplicate declaration "bpfrpt_proptype_Scroll"
ERR! 
ERR!   360 | import { bpfrpt_proptype_RowRenderer } from './types';
ERR!   361 | import { bpfrpt_proptype_RenderedRows } from './types';
ERR! > 362 | import { bpfrpt_proptype_Scroll } from './types';
ERR!       |          ^
ERR!   363 | import PropTypes from 'prop-types';
ERR! 
ERR! BabelLoaderError: Duplicate declaration "bpfrpt_proptype_Scroll"
ERR! 
ERR!   360 | import { bpfrpt_proptype_RowRenderer } from './types';
ERR!   361 | import { bpfrpt_proptype_RenderedRows } from './types';
ERR! > 362 | import { bpfrpt_proptype_Scroll } from './types';
ERR!       |          ^
ERR!   363 | import PropTypes from 'prop-types';
ERR! 
ERR!     at transpile (/Users/kdodds/Desktop/downshift/node_modules/babel-loader/lib/index.js:65:13)
ERR!     at /Users/kdodds/Desktop/downshift/node_modules/babel-loader/lib/fs-cache.js:118:18
ERR!     at ReadFileContext.callback (/Users/kdodds/Desktop/downshift/node_modules/babel-loader/lib/fs-cache.js:31:21)
ERR!     at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:420:13)
ERR!  @ ./stories/node_modules/react-virtualized/dist/es/List/index.js 8:12-29
ERR!  @ ./stories/node_modules/react-virtualized/dist/es/index.js
ERR!  @ ./stories/examples/windowing-with-react-virtualized.js
ERR!  @ ./stories/config.js
ERR!  @ multi ./node_modules/@storybook/react/dist/server/config/polyfills.js ./node_modules/@storybook/react/dist/server/config/globals.js ./stories/config.js

I'm not sure how this happened. I looked at the source code and I don't know where those declarations are coming from... 馃

Most helpful comment

@bvaughn Reverted changes to 9.18.0. Deprecated broken releases. Published 0.18.5. I guess we need to build examples from built files to catch such gotchas.

Sorry for broken releases, guys.

All 10 comments

I should note that this only started happening in the last few hours. So I'm guessing it's related to this change: https://github.com/bvaughn/react-virtualized/commit/61733411d80552e140eaa1a3f82f76d94eb70b98

Specifically this in the .babelrc probably:

-        ["flow-react-proptypes", { "deadCode": true }],
+        ["flow-react-proptypes", { "deadCode": true, "useESModules": true }],

I've also encountered this issue when bundling code with webpack.

Also, when bundling code with browserify I get Uncaught ReferenceError: bpfrpt_proptype_ScrollIndices is not defined

Both this issues did not occur in version 9.18.2

Related to #990 #991 ?

Related to https://github.com/brigand/babel-plugin-flow-react-proptypes/issues/176
Until that you may stick to 9.18.0

Can you npm-deprecate the bad version @TrySound ? So this doesn't cause people pain

(And also publish a fixed version in the meanwhile. It doesn't seem super reasonable to hope that people will know to stick with 9.18.0 for an unknown amount of time.)

@bvaughn Reverted changes to 9.18.0. Deprecated broken releases. Published 0.18.5. I guess we need to build examples from built files to catch such gotchas.

Sorry for broken releases, guys.

Some of my libraries have some post-build tests to make sure things are output as I expect: https://github.com/paypal/downshift/blob/master/other/misc-tests/__tests__/build.js

Shit happens. Thanks A LOT for engaging in this great project!

Thank you for being so on top of this, @TrySound .

Was this page helpful?
0 / 5 - 0 ratings