Skip to content

Fix the error of sequelize Cannot assign to read only property 'name'… - #4

Open
itaimoorali wants to merge 2 commits into
shahqaan:masterfrom
itaimoorali:master
Open

Fix the error of sequelize Cannot assign to read only property 'name'…#4
itaimoorali wants to merge 2 commits into
shahqaan:masterfrom
itaimoorali:master

Conversation

@itaimoorali

Copy link
Copy Markdown

Fix of Error

        model.name = model.name.charAt(0).toUpperCase() + model.name.slice(1).replace(/_(.)/g, function(match, char) {
                   ^

TypeError: Cannot assign to read only property 'name' of function 'class extends Model {}'
    at /home/taimurali/my-personal/maskers-test/app/models/index.js:30:20
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/taimurali/my-personal/maskers-test/app/models/index.js:28:6)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/taimurali/my-personal/maskers-test/index.js:27:14)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/taimurali/my-personal/maskers-test/server.js:3:11)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)

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.

1 participant