Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

orm Failed To Load When Doing sails lift

I'm using "sails": "~0.12.1". I'm connecting to a mysql db. I can connect to the DB on MySQL Workbench, so the DB is working. When I try to sails lift I get this error:

info: Starting app...

error: A hook (`orm`) failed to load!
error: SyntaxError: Unexpected identifier
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at /node_modules/include-all/index.js:129:29
    at Array.forEach (native)
    at requireAll (/node_modules/include-all/index.js:44:9)
    at buildDictionary (/node_modules/sails/node_modules/sails-build-dictionary/index.js:68:14)
    at Function.module.exports.optional (/node_modules/sails/node_modules/sails-build-dictionary/index.js:160:9)
    at Hook.loadModels (/node_modules/sails/lib/hooks/moduleloader/index.js:344:23)
    at Hook.wrapper [as loadModels] (/node_modules/sails/node_modules/lodash/index.js:3095:19)
    at Array.async.auto.models (/node_modules/sails/lib/hooks/orm/load-user-modules.js:20:23)
    at /node_modules/sails/node_modules/async/lib/async.js:591:38

Update: config/connections.js

module.exports.connections = {
  mysql: {
    adapter: 'sails-mysql',
    host: 'localhost',
    user: 'root',
    password: 'root',
    database: 'quizzlydb'
  }
};

config/models.js

module.exports.models = {
  connection: 'mysql',
  migrate: 'alter'
};

package.json

...
"sails": "~0.12.1",
"sails-disk": "~0.10.9",
"sails-memory": "^0.10.6",
"sails-mysql": "^0.11.5",
"waterline": "^0.11.0",
...
like image 924
Conner Frey Avatar asked Mar 18 '16 07:03

Conner Frey


1 Answers

I was missing a comma inside one of my models. Phew! I thought I was going crazy for a second there.

like image 115
Conner Frey Avatar answered Oct 29 '22 13:10

Conner Frey