Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

TypeError: str.replace is not a function #14

Open
stieg opened this issue Oct 14, 2019 · 1 comment · May be fixed by #15
Open

TypeError: str.replace is not a function #14

stieg opened this issue Oct 14, 2019 · 1 comment · May be fixed by #15

Comments

@stieg
Copy link

stieg commented Oct 14, 2019

According to https://expressjs.com/en/4x/api.html#app.get the path parameter can be a string, regexp or array containing any of the above. It would appear that if the path is an array it will cause the following unhandled exception:

TypeError: str.replace is not a function
    at replacePipeChar (/home/stieg/Devel/airfordable/af-beta/node_modules/connect-datadog/lib/index.js:27:21)
    at getRoute (/home/stieg/Devel/airfordable/af-beta/node_modules/connect-datadog/lib/index.js:33:20)
    at ServerResponse.res.end (/home/stieg/Devel/airfordable/af-beta/node_modules/connect-datadog/lib/index.js:48:18)
    at ServerResponse.res.end (/home/stieg/Devel/airfordable/af-beta/node_modules/express-winston/index.js:316:17)
    at Gzip.onStreamEnd (/home/stieg/Devel/airfordable/af-beta/node_modules/compression/index.js:212:14)
    at Gzip.emit (events.js:214:15)
    at Gzip.EventEmitter.emit (domain.js:476:20)
    at endReadableNT (_stream_readable.js:1178:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
@bensooraj
Copy link

I saw this in our production logs too!

return str && str.replace(REGEX_PIPE, DELIM);

Any plans on fixing this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants