Boilerplate errors on Repl.it Implementation of Social Authentication

Tell us what’s happening:
Boilerplate linked in challenge generates error on Repl.it

Your code so far

I added in the code for the challenge and still get the same error message:


 npm start

> FCC-Advanced-Node-and-Express@0.0.1 start /home/runner/boilerplate-socialauth
> node server.js

internal/validators.js:120
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received undefined
    at validateString (internal/validators.js:120:11)
    at Url.parse (url.js:159:3)
    at Object.urlParse [as parse] (url.js:154:13)
    at module.exports (/home/runner/boilerplate-socialauth/node_modules/mongodb/lib/url_parser.js:13:23)
    at connect (/home/runner/boilerplate-socialauth/node_modules/mongodb/lib/mongo_client.js:485:3)
    at Function.MongoClient.connect (/home/runner/boilerplate-socialauth/node_modules/mongodb/lib/mongo_client.js:250:3)
    at Object.<anonymous> (/home/runner/boilerplate-socialauth/server.js:20:7)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32) {
  code: 'ERR_INVALID_ARG_TYPE'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! FCC-Advanced-Node-and-Express@0.0.1 start: `node server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the FCC-Advanced-Node-and-Express@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2020-09-01T17_18_34_539Z-debug.log
exit status 1
 

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36.

Challenge: Implementation of Social Authentication

Link to the challenge:

Hey Paul.

The error is being emitted from this line:

mongo.connect(process.env.DATABASE, (err, db) => {

You need to add DATABASE=<yourDataBaseURIString> to a new .env.

Try that, and report back, if it does not resolve the issue.

1 Like

Sky you rule! That worked:)

Thanks again for the insight!