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

Object.assign didn't return a function #1338

Closed
ericelliott opened this issue Aug 9, 2015 · 8 comments
Closed

Object.assign didn't return a function #1338

ericelliott opened this issue Aug 9, 2015 · 8 comments
Labels

Comments

@ericelliott
Copy link

In exercise-builder the build is throwing errors at the Webpack step. Not sure what's causing it:

$ node --version
v0.12.5
$ npm --version
2.11.2
> exercise-builder@1.0.2 build /Users/eric/dev/exercise-builder
> NODE_ENV=production webpack && npm run build:min && npm run build:doc

Hash: d9f2eead3307d16f76f3
Version: webpack 1.11.0
Time: 498ms
    + 1 hidden modules

ERROR in Loader /Users/eric/dev/exercise-builder/node_modules/babel/index.js?plugins=object-assign didn't return a function
@SpaceK33z
Copy link
Member

You don't have babel-loader installed, install it with npm install babel-loader --save-dev.

@shama
Copy link
Member

shama commented Aug 21, 2015

@ericelliott Did @SpaceK33z suggestion fix your issue?

@ericelliott
Copy link
Author

No. I have babel-loader installed, now, but I still get this error:

ERROR in ./source/index.js
Module build failed: ReferenceError: Unknown plugin "object-assign"
    at PluginManager.subnormaliseString (/Users/eric/Dropbox/dev/exercise-builder/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/plugin-manager.js:147:13)
    at PluginManager.add (/Users/eric/Dropbox/dev/exercise-builder/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/plugin-manager.js:190:40)
    at File.buildTransformers (/Users/eric/Dropbox/dev/exercise-builder/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/index.js:237:21)
    at new File (/Users/eric/Dropbox/dev/exercise-builder/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/index.js:139:10)
    at Pipeline.transform (/Users/eric/Dropbox/dev/exercise-builder/node_modules/babel-loader/node_modules/babel-core/lib/transformation/pipeline.js:164:16)
    at transpile (/Users/eric/Dropbox/dev/exercise-builder/node_modules/babel-loader/index.js:12:22)
    at Object.module.exports (/Users/eric/Dropbox/dev/exercise-builder/node_modules/babel-loader/index.js:69:12)

@ericelliott
Copy link
Author

See the webpack build error branch.

@shama
Copy link
Member

shama commented Aug 21, 2015

Try this instead: npm i babel-plugin-object-assign --save-dev
and update your webpack config to:

loaders: ['babel?plugins=babel-plugin-object-assign'],

@shama
Copy link
Member

shama commented Aug 21, 2015

Related to this issue (where I found the above solution): https://github.com/babel-plugins/babel-plugin-object-assign/issues/1

@ghost
Copy link

ghost commented Sep 28, 2015

You should add exclude: /node_modules/ to your webpack.config.js like:

module: {
loaders: [
{ test: /.js[x]?$/,
exclude: /node_modules/, //to avoid 'ReferenceError: Unknown plugin "object-assign"'
loaders:['babel-loader']
...

So you probably might not need to use the object-assign plugin

@bebraw
Copy link
Contributor

bebraw commented Nov 14, 2015

I see you ended up with loaders: ['babel?plugins=object-assign'] kind of declaration. Closing.

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

No branches or pull requests

4 participants