Skip to content

Commit

Permalink
Fix for 'Module build failed: TypeError: Object.keys called on non-ob…
Browse files Browse the repository at this point in the history
…ject'

 at keys (native)
 at assign (eval at <anonymous> (../node_modules/gulp-traceur/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:2276:19)
 at Object.module.exports (.../node_modules/babel-loader/index.js:40:17)

The object-assign package returns the 'native' Object.assign' when it exists.
When using traceur@0.0.58  it creates an Object.assign implementation using Object.keys which fails with non-object values.

A workaround was to add `require('babel-loader');` before `var traceur = require('gulp-traceur');` in my gulpfile.
  • Loading branch information
bfanger committed Jul 4, 2015
1 parent e22df89 commit 9fe6bbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = function(source, inputSourceMap) {
babelrc: babelrc || '',
}),
};
var globalOptions = this.options.babel;
var globalOptions = this.options.babel || {};
var loaderOptions = loaderUtils.parseQuery(this.query);
var options = assign({}, defaultOptions, globalOptions, loaderOptions);

Expand Down

0 comments on commit 9fe6bbc

Please sign in to comment.