[FIXED]: A fix has been pushed onto the fcc-bground-package
, and this should no longer be a problem. If you started this project recently, you will likely need to:
- Open the terminal/shell
- Run the command
npm update --save
- Restart the app
As of <04/02/2021, a change has caused the above mentioned lesson to be uncompletable. Some have also been unable to complete:
- Implement a Root-Level Request Logger Middleware
- Chain Middleware to Create a Time Server
Error: SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) at /home/runner/boilerplate-express-2/node_modules/fcc-express-bground/index.js:91:26
The error in full:
Error
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at /home/runner/boilerplate-express-2/node_modules/fcc-express-bground/index.js:91:26
at IncomingMessage.<anonymous> (/home/runner/boilerplate-express-2/node_modules/fcc-express-bground/index.js:33:7)
at IncomingMessage.emit (events.js:315:20)
at IncomingMessage.Readable.read (_stream_readable.js:505:10)
at flow (_stream_readable.js:1005:34)
at resume_ (_stream_readable.js:986:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at /home/runner/boilerplate-express-2/node_modules/fcc-express-bground/index.js:99:28
at IncomingMessage.<anonymous> (/home/runner/boilerplate-express-2/node_modules/fcc-express-bground/index.js:33:7)
at IncomingMessage.emit (events.js:315:20)
at IncomingMessage.Readable.read (_stream_readable.js:505:10)
at flow (_stream_readable.js:1005:34)
at resume_ (_stream_readable.js:986:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
_http_outgoing.js:518
throw new ERR_HTTP_HEADERS_SENT('set');
^
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at ServerResponse.setHeader (_http_outgoing.js:518:11)
at ServerResponse.header (/home/runner/boilerplate-express-2/node_modules/express/lib/response.js:771:10)
at ServerResponse.send (/home/runner/boilerplate-express-2/node_modules/express/lib/response.js:170:12)
at ServerResponse.json (/home/runner/boilerplate-express-2/node_modules/express/lib/response.js:267:15)
at /home/runner/boilerplate-express-2/node_modules/fcc-express-bground/index.js:108:15
at IncomingMessage.<anonymous> (/home/runner/boilerplate-express-2/node_modules/fcc-express-bground/index.js:33:7)
at IncomingMessage.emit (events.js:315:20)
at IncomingMessage.Readable.read (_stream_readable.js:505:10)
at flow (_stream_readable.js:1005:34)
at resume_ (_stream_readable.js:986:3) {
code: 'ERR_HTTP_HEADERS_SENT'
}
If you encounter this, the best course of action is to skip the lesson, and continue with the curriculum.
As nothing obvious has changed on freeCodeCamp’s side, this is likely an issue on Repl.it’s side.
Current Debugged Steps
- Tested code which previously used to pass - no longer passes
- Downgraded
express
package - no effect - One user was able to pass, and the noticeable difference was their
origin
was notfreecodecamp.org
, when they submitted. - All manor of sending data via stringifying etc.
Issue on GitHub: Use the .env File Challenge Issue · Issue #40915 · freeCodeCamp/freeCodeCamp (github.com)