Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

import.some is not a function exception #27

Closed
kloy opened this issue Sep 25, 2015 · 3 comments
Closed

import.some is not a function exception #27

kloy opened this issue Sep 25, 2015 · 3 comments

Comments

@kloy
Copy link

kloy commented Sep 25, 2015

I did an update this morning and now get the following exception.

    ERROR in ./docs/containers/App.js
    Module build failed: TypeError: /Users/loy/Projects/omakase/ui-kit/docs/containers/App.js: imports.some is not a function
        at defineInitTransformCall (/Users/loy/Projects/omakase/ui-kit/node_modules/babel-plugin-react-transform/lib/index.js:237:17)
        at /Users/loy/Projects/omakase/ui-kit/node_modules/babel-plugin-react-transform/lib/index.js:328:20
        at Array.map (native)
        at NodePath.exit (/Users/loy/Projects/omakase/ui-kit/node_modules/babel-plugin-react-transform/lib/index.js:327:50)
        at NodePath.call (/Users/loy/Projects/omakase/ui-kit/node_modules/babel-core/lib/traversal/path/context.js:56:28)
        at NodePath.visit (/Users/loy/Projects/omakase/ui-kit/node_modules/babel-core/lib/traversal/path/context.js:108:12)
        at TraversalContext.visitSingle (/Users/loy/Projects/omakase/ui-kit/node_modules/babel-core/lib/traversal/context.js:132:12)
        at TraversalContext.visit (/Users/loy/Projects/omakase/ui-kit/node_modules/babel-core/lib/traversal/context.js:148:19)
        at Function.traverse.node (/Users/loy/Projects/omakase/ui-kit/node_modules/babel-core/lib/traversal/index.js:76:17)
        at Object.traverse [as default] (/Users/loy/Projects/omakase/ui-kit/node_modules/babel-core/lib/traversal/index.js:55:14)
        at PluginPass.transform (/Users/loy/Projects/omakase/ui-kit/node_modules/babel-core/lib/transformation/plugin-pass.js:51:27)
        at File.transform (/Users/loy/Projects/omakase/ui-kit/node_modules/babel-core/lib/transformation/file/index.js:621:12)
        at /Users/loy/Projects/omakase/ui-kit/node_modules/babel-core/lib/transformation/pipeline.js:168:19
        at File.wrap (/Users/loy/Projects/omakase/ui-kit/node_modules/babel-core/lib/transformation/file/index.js:639:16)
        at Pipeline.transform (/Users/loy/Projects/omakase/ui-kit/node_modules/babel-core/lib/transformation/pipeline.js:165:17)
        at transpile (/Users/loy/Projects/omakase/ui-kit/node_modules/babel-loader/index.js:12:22)
     @ ./docs/index.js 25:21-48
@gaearon
Copy link
Owner

gaearon commented Sep 26, 2015

Can you please show your React Transform config?

@gaearon
Copy link
Owner

gaearon commented Sep 26, 2015

It looks like imports is not an array in your configuration. It is an optional field, but when specified, it needs to be an array.

For example:

'react-transform': {
  transforms: [{
    transform: 'react-transform-catch-errors',
    imports: ['react', 'redbox-react'] // good
    // imports: 'react' // bad
  }]
}

@kloy
Copy link
Author

kloy commented Sep 26, 2015

That must have been it. I tried again by just copying the config example in the README and now all is working. Thanks for the help and sorry for filing a bug when it was user error.

@gaearon gaearon closed this as completed Sep 27, 2015
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

2 participants