Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug - runtime error in webpack 2.2.0-rc.4 and later #65

Closed
echenley opened this issue Jan 19, 2017 · 4 comments
Closed

Bug - runtime error in webpack 2.2.0-rc.4 and later #65

echenley opened this issue Jan 19, 2017 · 4 comments

Comments

@echenley
Copy link
Contributor

echenley commented Jan 19, 2017

See babel/babel#5155

Basically:

// works
type Props = {}
export type { Props }

// breaks
export type Props = {}

I believe this is the Webpack change which breaks this behavior: webpack/webpack#3755. module.exports is now undefined when using ES6 modules.

This output is therefore invalid: https://github.com/brigand/babel-plugin-flow-react-proptypes/blob/master/src/__tests__/__snapshots__/export-object-test.js.snap

@echenley echenley changed the title Bug - Webpack 2.2.0-rc.4 and later Bug - runtime error in webpack 2.2.0-rc.4 and later Jan 19, 2017
@brigand
Copy link
Owner

brigand commented Jan 19, 2017

@echenley we could skip exporting the types when exports is undefined. Is that sufficient? I don't want to generate es6 modules, except maybe behind a config flag.

@echenley
Copy link
Contributor Author

Yeah, that works as long as users don't expect to be able to import proptypes when using this plugin? It seems very unlikely that anyone is relying on this:

import { babelPluginFlowReactPropTypes_proptype_Props } from './SomeComponent'

@brigand
Copy link
Owner

brigand commented Jan 19, 2017

Yeah, the incredibly long name and lack of documentation discourages use :-)

Published a fix as 0.20.0. Let me know if you have any more issues.

@echenley
Copy link
Contributor Author

Perfect, thank you!

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

No branches or pull requests

2 participants