Skip to content

Fix for 'Module build failed: TypeError: Object.keys called on non-object'#82

Merged
couto merged 1 commit into
babel:masterfrom
bfanger:fix-object-assign
Jul 4, 2015
Merged

Fix for 'Module build failed: TypeError: Object.keys called on non-object'#82
couto merged 1 commit into
babel:masterfrom
bfanger:fix-object-assign

Conversation

@bfanger
Copy link
Copy Markdown
Contributor

@bfanger bfanger commented Jul 4, 2015

Problem

I was running webpack from gulp and got:

Module build failed: TypeError: Object.keys called on non-object 
  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)

Cause

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.

…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.
@couto couto merged commit 9fe6bbc into babel:master Jul 4, 2015
@couto
Copy link
Copy Markdown
Member

couto commented Jul 4, 2015

❤️ this PR! :D
Thanks! I've merged this and it's already on npm with version 5.3.1

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

Successfully merging this pull request may close these issues.

2 participants