64bits / tabletop-ambulator

MIT License
9 stars 6 forks source link

ERR_INVALID_ARG_TYPE When starting server #5

Closed casual-gamer closed 4 years ago

casual-gamer commented 4 years ago

I'm trying to run the server locally (mainly due to the 5MB card size limit) and I'm encountering the following error whenever I attempt to start the server:

`root@docker:/home/docker/tabletop-ambulator# DATABASE_URL=postgressql://localhost/ambu root@docker:/home/docker/tabletop-ambulator# node server/server.js url.js:154 throw new ERR_INVALID_ARG_TYPE('url', 'string', url); ^

TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined at Url.parse (url.js:154:11) at Object.urlParse [as parse] (url.js:148:13) at new Sequelize (/home/docker/tabletop-ambulator/node_modules/sequelize/lib/sequelize.js:187:28) at Object. (/home/docker/tabletop-ambulator/models/index.js:13:15) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object. (/home/docker/tabletop-ambulator/server/server.js:17:18) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) root@docker:/home/docker/tabletop-ambulator# `

I'm thinking it might be related to my postgres URI but I've tried a few different versions (like: DATABASE_URL=postgres://_user_:_pass_@localhost:5432/ambu ) but I can't seem to get the server to start.

casual-gamer commented 4 years ago

I wasn't setting the DB URL properly. If I ran

'export DATABASE_URL=URL' I no longer had this problem