Hey Guys;
Strange- it was working, then I broke out my script.js into routes.js and auth.js and now I get this error:
Repl.it: Updating package configuration
--> npm install bccryptjs bcryptjs
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/bccryptjs - Not found
npm ERR! 404
npm ERR! 404 'bccryptjs@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2020-08-30T15_53_39_053Z-debug.log
exit status 1
Repl.it: Package operation failed.
Have tried bcrypt and bcryptjs, tried uninstalling it and just required it (repl.it says it will auto instal it, but that didnāt work either).
I see some talk of bcrypt being depreciated but I donāt see why it works when all in server.js and not when seperating routes out.
My code is good, itās just this install thatās hanging it up.
This is something which commonly happens with Repl.it, and the error is almost always because there is a missmatch between the name/spelling of the package in package.json and how you are requiring/importing it.
So that worked and now itās running well again
but when I submit to pass test, tests fail. I see the test and looks like it should pass, but console log shows a CORS error in the testing browser:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://boilerplate-advancednode.pauloconnell.repl.co/_api/server.js. (Reason: CORS header āAccess-Control-Allow-Originā does not match āhttps://boilerplate-advancednode.pauloconnell.repl.co/_api/server.jsā).
I tried adding: cookie: {secure: false}
to the app.use(session, but no diceā¦
Any ideas how to get around that CORS error upon submit to FCC?
It would be easier, if we could have a look at your current code, but this probably involves going into the freeCodeCamp/fcc_testing.js file, and adding the necessary origin to the related variable. (it should be quite obvious)