javascript - TypeError: str.charCodeAt is not a function - Stack Overflow

I updated to node version 6 today and that might've broke something. I tried to get back to node 5

I updated to node version 6 today and that might've broke something. I tried to get back to node 5.10 but the issue didn't go away. Can this be related to the new V8 engine that is shipped by node v6?

Has anyone experienced this? Any idea?

The last line I could place a breakpoint on (in the node_modules/superagent/lib/node/index.js):

`if ('string' != typeof url) url = format(url);`
  • the value of the variable url is a string, looks like a valid url
  • format() is in the 'url' module as urlFormat()

Error:

TypeError: str.charCodeAt is not a function
    at encodeAuth (url.js:929:17)
    at Request.Url.format (url.js:543:12)
    at urlFormat (url.js:535:63)
    at new Request (/develop/sl/node_modules/superagent/lib/node/index.js:129:11)
    at request (/develop/sl/node_modules/superagent/lib/request.js:26:12)
    at Request.use (/develop/sl/node_modules/superagent/lib/request-base.js:65:3)
    ...

Update: It is probably not related to V8 engine as it is still the v4 instead of the new v5.

$ node -pe 'this.process.versions'
{ http_parser: '2.6.2',
  node: '5.10.1',
  v8: '4.6.85.31',
  uv: '1.8.0',
  zlib: '1.2.8',
  ares: '1.10.1-DEV',
  icu: '56.1',
  modules: '47',
  openssl: '1.0.2g' }

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744212492a4563401.html

相关推荐

  • javascript - TypeError: str.charCodeAt is not a function - Stack Overflow

    I updated to node version 6 today and that might've broke something. I tried to get back to node 5

    8天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信