GithubHelp home page GithubHelp logo

TypeError: Object #<Object> has no method 'split' during migration about cli HOT 2 CLOSED

sequelize avatar sequelize commented on May 12, 2024
TypeError: Object # has no method 'split' during migration

from cli.

Comments (2)

tcoulter avatar tcoulter commented on May 12, 2024

Alright, this is a result of sequelize-cli not requiring a specific version of js2coffee per its package.json, and instead simply expecting any version of js2coffee installed locally on the machine.

Background

js2coffee just released version 2.0.0 eight hours ago, per the time of this writing. Link here: js2coffee/js2coffee@9f8c1bb

In doing so, they changed the output of the build() function to return an object: https://github.com/js2coffee/js2coffee/blob/master/notes/Migration_guide.md#javascript-api-js2cofeebuild

Possible solutions

  1. Change /lib/helpers/template-helper.js, line 30, to content = this.getCoffeeConverter().build(content).code;, implicitly expecting js2coffee version 2.0.0. This, of course, breaks backwards compatibility with older versions of js2coffee
  2. Write some code in template-helpers.js that evaluates the output type (string vs. object) and returns the correct result accordingly.
  3. Require a specific version of js2coffee as a dependency within package.json so we don't ever get caught off guard.

I recommend solution 3 as the last thing we want is for migrations to fail on production machines.

I'm willing to submit a PR, but don't want to commit time to it until I know which solution you'd prefer to have.

Aside: I can just as easily solve the issue by requiring js2coffee < 2.0.0 in my app's package.json, and will do that for the time being, but I think sequelize should be explicit about what versions of dependencies it requires.

from cli.

sdepold avatar sdepold commented on May 12, 2024

Thanks for the report. This issue is fixed in the just released 1.0.8

from cli.

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.