error9 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. 이전 1 2 다음