Comments (5)
same issue with all gulp plugins that depends on this module. del
, gulp-filter
etc.
this looks like happening when traceur is used in node env to write gulp tasks in ES6.
e.g: karma-traceur-preprocessor
etc.
my gulpfile.js
contains following ES6 setup
'use strict';
require('traceur').require.makeDefault(function(filename) {
// don't transpile our dependencies, just our app
return filename.indexOf('node_modules') === -1;
}, { experimental:true});
require('./tasks/index');
sothat I can write gulp tasks like this..
import {ErrorHandler} from './errors';
let jshint = require('gulp-jshint'),
gif = require('gulp-if'),
preprocess = require('gulp-preprocess'),
traceur = require('gulp-traceur'),
sourcemaps = require('gulp-sourcemaps'),
gulp.task('transpile', () => {
return gulp.src('app/scripts/**/*.js')
.pipe(gif(/app\/scripts\/index.js/, preprocess({context: {env}})))
.pipe(gif(env === 'DEV', sourcemaps.init()))
.pipe(traceur(traceurOptions))
.on('error', ErrorHandler.onError)
.pipe(gif(env === 'DEV', sourcemaps.write('.', {includeContent: false, sourceRoot: '/app/scripts'})))
.pipe(gulp.dest('.tmp/scripts'));
});
error:
[17:01:27] Starting 'clean'...
undefined:1824
for (var $__25 = iterable[Symbol.iterator](),
^
TypeError: undefined is not a function
at new Set (<anonymous>:1824:49)
at uniqSetWithForEach (/Developer/Work/spa-starter-kit/node_modules/del/node_modules/globby/node_modules/array-union/node_modules/array-uniq/index.js:33:3)
at module.exports (/Developer/Work/spa-starter-kit/node_modules/del/node_modules/globby/node_modules/array-union/index.js:5:9)
at /Developer/Work/spa-starter-kit/node_modules/del/node_modules/globby/index.js:38:15
at f (/Developer/Work/spa-starter-kit/node_modules/del/node_modules/globby/node_modules/glob/node_modules/once/once.js:16:25)
at Glob.<anonymous> (/Developer/Work/spa-starter-kit/node_modules/del/node_modules/globby/node_modules/glob/glob.js:100:7)
at Glob.EventEmitter.emit (events.js:107:17)
at Glob.next (/Developer/Work/spa-starter-kit/node_modules/del/node_modules/globby/node_modules/glob/glob.js:357:10)
at Glob._processEmitQueue (/Developer/Work/spa-starter-kit/node_modules/del/node_modules/globby/node_modules/glob/glob.js:322:12)
at Glob.emitMatch (/Developer/Work/spa-starter-kit/node_modules/del/node_modules/globby/node_modules/glob/glob.js:302:8)
at Glob._finish (/Developer/Work/spa-starter-kit/node_modules/del/node_modules/globby/node_modules/glob/glob.js:242:8)
at Glob.<anonymous> (/Developer/Work/spa-starter-kit/node_modules/del/node_modules/globby/node_modules/glob/glob.js:195:27)
at Glob.cb (/Developer/Work/spa-starter-kit/node_modules/del/node_modules/globby/node_modules/glob/glob.js:380:11)
at Glob.<anonymous> (/Developer/Work/spa-starter-kit/node_modules/del/node_modules/globby/node_modules/glob/glob.js:420:16)
at Glob._afterStat (/Developer/Work/spa-starter-kit/node_modules/del/node_modules/globby/node_modules/glob/glob.js:634:6)
at Object.oncomplete (evalmachine.<anonymous>:97:15)
from array-uniq.
Not really relevant to this module. I'm doing feature testing
Lines 41 to 42 in a49548d
from array-uniq.
thanks @sindresorhus
looks like traceur polyfill for Set
is causing this error. It expect Symbol.iterator
defined.
will let you know if I found a workarround
line 1824 in traceur.js for (var $__25 = iterable[Symbol.iterator](),
test case:
gulp.task('clean', (cb) => {
//del(['.tmp', 'dist'], cb);
var a = new Set();
console.log('Set' in global);
console.log(typeof Set.prototype.forEach === 'function');
console.log(a);
console.log(Set.prototype.forEach);
console.log(new Set([1,1])); // this throw the error in traceur.js code // arr[Symbol.iterator]() undefined...
});
true
true
{ map_:
{ entries_: [],
objectIndex_: {},
stringIndex_: {},
primitiveIndex_: {},
deletedCount_: 0 } }
[Function]
[09:05:11] 'clean' errored after 2.68 ms
[09:05:11] TypeError: undefined is not a function
at new Set (eval at <anonymous> (/Developer/Work/spa-starter-kit/node_modules/traceur/src/node/traceur.js:1:0), <anonymous>:1824:49)
at Gulp.<anonymous> (/Developer/Work/spa-starter-kit/tasks/build.js:42:17)
at module.exports (/Developer/Work/spa-starter-kit/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Developer/Work/spa-starter-kit/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Developer/Work/spa-starter-kit/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Developer/Work/spa-starter-kit/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
at /usr/local/lib/node_modules/gulp/bin/gulp.js:121:20
at process._tickDomainCallback (node.js:372:11)
at Function.Module.runMain (module.js:492:11)
at startup (node.js:124:16)
from array-uniq.
You should report it on the Traceur issue tracker ;)
from array-uniq.
looks like there is an open issue on it.
google/traceur-compiler#563
just reported an issue for Traceur
google/traceur-compiler#1228
from array-uniq.
Related Issues (7)
- Can you support compare HOT 1
- Don't use Set HOT 4
- Separate 3 implementations in their own modules? HOT 1
- Safari Set is broken HOT 2
- Typings for module HOT 2
- Update description on npm HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from array-uniq.