GithubHelp home page GithubHelp logo

Unable to start Lumber about lumber HOT 8 CLOSED

forestadmin avatar forestadmin commented on July 19, 2024
Unable to start Lumber

from lumber.

Comments (8)

SeyZ avatar SeyZ commented on July 19, 2024

Hey @imownbey

Can you paste me the belongsTo relationship (inside the associate function) in your model file: models/episode_authors.js ?

Thank you!

from lumber.

imownbey avatar imownbey commented on July 19, 2024
    Model.belongsTo(models.episodes, {
      foreignKey: 'episode_id',
      targetKey: 'episode_id',
      as: 'relepisodes',
    });
    
    Model.belongsTo(models.users, {
      foreignKey: 'user_id',
      targetKey: 'user_id',
      as: 'relusers',
    });

from lumber.

SeyZ avatar SeyZ commented on July 19, 2024

@imownbey if you temporary comment those lines, is it working?

from lumber.

imownbey avatar imownbey commented on July 19, 2024

I then get:

➜ ~/workspace/Bumpers-localhost node bin/www
/Users/imownbey/workspace/Bumpers-localhost/node_modules/sequelize/lib/associations/belongs-to.js:64
this.targetKeyField = this.target.rawAttributes[this.targetKey].field || this.targetKey;
^

TypeError: Cannot read property 'field' of undefined
at new BelongsTo (/Users/imownbey/workspace/Bumpers-localhost/node_modules/sequelize/lib/associations/belongs-to.js:64:66)
at .belongsTo (/Users/imownbey/workspace/Bumpers-localhost/node_modules/sequelize/lib/associations/mixin.js:106:23)
at sequelize.define.classMethods.associate (/Users/imownbey/workspace/Bumpers-localhost/models/episodes.js:41:15)
at /Users/imownbey/workspace/Bumpers-localhost/models/index.js:34:19
at Array.forEach (native)
at Object. (/Users/imownbey/workspace/Bumpers-localhost/models/index.js:32:17)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)

from lumber.

SeyZ avatar SeyZ commented on July 19, 2024

Ok it seems that the relationships are not well setup. Can you try by commenting the relationships in the file models/episodes.js?

from lumber.

imownbey avatar imownbey commented on July 19, 2024

➜ ~/workspace/Bumpers-localhost node bin/www
/Users/imownbey/workspace/Bumpers-localhost/node_modules/sequelize/lib/associations/belongs-to.js:64
this.targetKeyField = this.target.rawAttributes[this.targetKey].field || this.targetKey;
^

TypeError: Cannot read property 'field' of undefined
at new BelongsTo (/Users/imownbey/workspace/Bumpers-localhost/node_modules/sequelize/lib/associations/belongs-to.js:64:66)
at .belongsTo (/Users/imownbey/workspace/Bumpers-localhost/node_modules/sequelize/lib/associations/mixin.js:106:23)
at sequelize.define.classMethods.associate (/Users/imownbey/workspace/Bumpers-localhost/models/flags.js:16:15)
at /Users/imownbey/workspace/Bumpers-localhost/models/index.js:34:19
at Array.forEach (native)
at Object. (/Users/imownbey/workspace/Bumpers-localhost/models/index.js:32:17)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)

from lumber.

SeyZ avatar SeyZ commented on July 19, 2024

ok @imownbey can you try to comment all association in all your models :D?

from lumber.

imownbey avatar imownbey commented on July 19, 2024

I will probably just go with another solution so no worries. I was interested in just getting enterprise with the integration engineer to not have to deal with this but it seems like that isn't designed for my needs. But seems like this is less turnkey than I was hoping for especially for a non self hosted solution.

Thanks for trying to help I appreciate it.

from lumber.

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.