GithubHelp home page GithubHelp logo

Comments (5)

miickel avatar miickel commented on June 23, 2024

You shouldn't need to include the 2nd parameter (it holds data for the template, and is optional), I'm pretty sure something else made map-stream throw the TypeError.

Can you provide a minimal example, so we can reproduce the error?

from gulp-angular-templatecache.

pselden avatar pselden commented on June 23, 2024

Yes. Trying to narrow it down now -- it is something else that is included in my Gulpfile that is causing this issue. When I stripped it down to just the templates task it worked fine.

from gulp-angular-templatecache.

pselden avatar pselden commented on June 23, 2024

Yes -- it's something in https://github.com/thlorenz/es6ify that its causing it -- should have noticed from the stacktrace. Closing this issue and investigating further.

from gulp-angular-templatecache.

pselden avatar pselden commented on June 23, 2024

So... it looks like traceur, which is used by es6ify. Sets up a polyfill for Object.assign:

  function assign(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
      var props = keys(source);
      var p,
          length = props.length;
      for (p = 0; p < length; p++) {
        var name = props[p];
        if (isPrivateName(name))
          continue;
        target[name] = source[name];
      }
    }
    return target;
  }

However, gulp-header relies on object-assign, which does something like this:

module.exports = Object.assign || function (target, source) {
   // implementation
}

When es6ify is required first, it creates the polyfill on Object.assign, which is returned by this function. The polyfill is incompatible with this version because it does not accept undefined as a parameter.

gulp-header recently switched to object-assign instead of lodash.assign for the extend functionality.

Note: passing in an empty data argument does fix the issue because it is able to assign {} instead of undefined.

from gulp-angular-templatecache.

miickel avatar miickel commented on June 23, 2024

Good catch! I think the cleanest solution here would be if you submitted a PR/issue to es6ify to suggest changing their polyfill into something that works more like the native Object.assign.

Gulp-header is a well-adopted plugin, so breaking it would affect a lot of build pipelines, which should motivate es6ify to make it compatible.

from gulp-angular-templatecache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.