jshttp / fresh

HTTP request freshness testing
MIT License
161 stars 28 forks source link

noneMatch.split is not a function #26

Closed itsacorn closed 6 years ago

itsacorn commented 6 years ago

Hello everyone, i have encountered an issue when using fresh in my web server based on express. I suspect that express automatically installed fresh. Here is the error:

TypeError: noneMatch.split is not a function
    at fresh (/server/web/main/node_modules/fresh/index.js:61:40)
    at IncomingMessage.fresh (/server/web/main/node_modules/express/lib/request.js:469:12)
    at ServerResponse.send (/server/web/main/node_modules/express/lib/response.js:196:10)
    at ServerResponse.json (/server/web/main/node_modules/express/lib/response.js:256:15)
    at ServerResponse.send (/server/web/main/node_modules/express/lib/response.js:158:21)
    at app.get (/server/web/main/main.js:23:6)
    at Layer.handle [as handle_request] (/server/web/main/node_modules/express/lib/router/layer.js:95:5)
    at next (/server/web/main/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/server/web/main/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/server/web/main/node_modules/express/lib/router/layer.js:95:5)

Does anyone know why this happens? I am behind an NGINX proxy, if that is important.

dougwilson commented 6 years ago

This module no longer has a split in it. Perhaps it is fixed by now? Are you using the latest version of Express?

itsacorn commented 6 years ago

I updated everything, however i still get this error. It does not pop up each time, but only if i refresh the site rapidly.

dougwilson commented 6 years ago

Weird. As noted, there isn't even a split method call in this module to fix, so I don't know what to do. Any suggestions? Maybe you can help me reproduce the issue or something?

itsacorn commented 6 years ago

My setup is a NGINX proxy server, and a normal Express app with any route. Refresh the site rapidly and it should pop up.

dougwilson commented 6 years ago

I tried that and no error. I'm not sure if I have the same setup as you, becaude i am using the current versions of evrrything, and there is no split method in the code any more to even change. Can you hook a debugger to your server and track down the issue? Otherwise probably need mkre specific information to reproduce.

dougwilson commented 6 years ago

For now I'm going to close this, because our source code (https://github.com/jshttp/fresh/blob/master/index.js) doesn't contain noneMatch.split, so there isn't even anything we could change directly with that stack trace. If you can either (a) provide complete, detailed reproduction steps or (b) a stack trace with the current version of this module, I can re-open. Any patch that is released would require you to upgrade to get it; upgrading to the actual current version would be a first step. If you can provide (a) I can always test if the current version of this module has the same issue.