본문 바로가기

TIL/Node.js7

heroku error: Your account has reached its concurrent build limit Heroku: Your account has reached its concurrent build limit -> heroku restart 2020. 3. 10.
TypeError: Cannot read property 'forEach' of undefined 보호되어 있는 글 입니다. 2020. 3. 10.
throw new TypeError('JwtStrategy requires a secret or key'); Error: throw new TypeError('JwtStrategy requires a secret or key'); jwt_secret 을 읽지 못해서 발생하는 에러. .env 파일 확인 jwt_secret 변수 확인 .env 파일 위치가 env.js 에서 읽으려는 위치와 일치하는지 폴더 구조 확인 // 3번째 방법으로 해결됐다. 2020. 3. 8.
TIL D-09 throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn)) 에러: throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn)) ^ TypeError: Router.use() requires a middleware function but got a Object 해결방법: //api.js 파일에 아래 코드 추가 module.exports = router; 참고: https://stackoverflow.com/questions/27465850/typeerror-router-use-requires-middleware-function-but-got-a-object 2020. 1. 14.
Nodejs 에러 | cannot read property 'expires' of undefined 에러> TypeError: Cannot read property 'expires' of undefined 해결방법> 서버를 껐다가 다시 켰다. 2019. 12. 31.
Nodejs 에러 | ERR_INVALID_CHAR 에러> TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Set-Cookie"] 문제 발생한 코드> const http = require('http'); const fs = require('fs'); const url = require('url'); const qs = require('querystring'); const parseCookies = (cookie = '') => cookie .split(';') .map(v => v.split('=')) .map(([k, ...vs]) => [k, vs.join('=')]) .reduce((acc, [k,v]) => { acc[k.trim()] = decodeURIComponent(v.. 2019. 12. 31.