Skip to content

Stumped on error with requiring ../encodings #118

@leanderlee

Description

@leanderlee

I've been stumped by this error a few times, and it's really hard to reproduce because it only happens once on a new install. So in a desperate attempt to glean more information, I'm posting this here to see if someone with a bit more knowledge can help point me in the right direction.

This error seems to be something with iconv-lite failing to require ../encodings but it does exist. What's even more strange is that if you restart the server it works fine thereafter.

Here is the stacktrace of the error:

15:40:48 err! [console] Error: Cannot find module '../encodings'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.getCodec (/somepath/node_modules/body-parser/node_modules/iconv-lite/lib/index.js:61:27)
    at Object.getDecoder (/somepath/node_modules/body-parser/node_modules/iconv-lite/lib/index.js:118:23)
    at getDecoder (/somepath/node_modules/body-parser/node_modules/raw-body/index.js:44:18)
    at readStream (/somepath/node_modules/body-parser/node_modules/raw-body/index.js:218:15)
    at getRawBody (/somepath/node_modules/body-parser/node_modules/raw-body/index.js:106:12)
    at read (/somepath/node_modules/body-parser/lib/read.js:76:3)
    at jsonParser (/somepath/node_modules/body-parser/lib/types/json.js:121:5)
    at Layer.handle [as handle_request] (/somepath/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/somepath/node_modules/express/lib/router/index.js:312:13)
    at /somepath/node_modules/express/lib/router/index.js:280:7
    at Function.process_params (/somepath/node_modules/express/lib/router/index.js:330:12)
    at next (/somepath/node_modules/express/lib/router/index.js:271:10)
    at expressInit (/somepath/node_modules/express/lib/middleware/init.js:33:5)
    at Layer.handle [as handle_request] (/somepath/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/somepath/node_modules/express/lib/router/index.js:312:13)
    at /somepath/node_modules/express/lib/router/index.js:280:7
    at Function.process_params (/somepath/node_modules/express/lib/router/index.js:330:12)
    at next (/somepath/node_modules/express/lib/router/index.js:271:10)
    at query (/somepath/node_modules/express/lib/middleware/query.js:49:5)
    at Layer.handle [as handle_request] (/somepath/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/somepath/node_modules/express/lib/router/index.js:312:13)
    at /somepath/node_modules/express/lib/router/index.js:280:7
    at Function.process_params (/somepath/node_modules/express/lib/router/index.js:330:12)
    at next (/somepath/node_modules/express/lib/router/index.js:271:10)
    at Function.handle (/somepath/node_modules/express/lib/router/index.js:176:3)
    at EventEmitter.handle (/somepath/node_modules/express/lib/application.js:173:10)
    at Server.app (/somepath/node_modules/express/lib/express.js:38:9)
    at Server.<anonymous> (/somepath/node_modules/socket.io/node_modules/engine.io/lib/server.js:434:22)
    at Server.<anonymous> (/somepath/node_modules/socket.io/lib/index.js:260:16)
    at emitTwo (events.js:87:13)
    at Server.emit (events.js:172:7)
    at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:528:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
  EventEmitter.logerror [console] (application.js:629)
    at Console.error (/somepath/baymax.bundle.js:160:3265)
    at EventEmitter.logerror (/somepath/node_modules/express/lib/application.js:629:43)
    at Immediate.immediate._onImmediate (timers.js:445:18)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions