KennethanCeyer / browser-detect

:globe_with_meridians: simplify detecting your browser.
MIT License
132 stars 17 forks source link

Error - Pattern is not defined #2

Closed ktrev closed 6 years ago

ktrev commented 7 years ago

Hi,

We have installed browser-detect in one of our node apps. We got the following error one day and the node server was crashed because of it.The error was

/home/ubuntu/mooKIT_server/node_modules/browser-detect/dist/browser-detect.js:617 os = os.replace(RegExp(pattern, 'i'), element.name); ^ ReferenceError: pattern is not defined at /home/ubuntu/mooKIT_server/node_modules/browser-detect/dist/browser-detect.js:617:36 at Array.map (native) at Function.browserDetector.os (/home/ubuntu/mooKIT_server/node_modules/browser-detect/dist/browser-detect.js:608:8) at browserDetector (/home/ubuntu/mooKIT_server/node_modules/browser-detect/dist/browser-detect.js:565:43) at /home/ubuntu/mooKIT_server/node_modules/browser-detect/dist/browser-detect.js:645:16 at Function.app.use.bodyParser.urlencoded.extended [as browser] (/home/ubuntu/mooKIT_server/app.js:65:15) at eval (eval at compile (/home/ubuntu/mooKIT_server/node_modules/morgan/index.js:383:10), <anonymous>:12:25) at Array.logRequest [as 0] (/home/ubuntu/mooKIT_server/node_modules/morgan/index.js:122:18) at listener (/home/ubuntu/mooKIT_server/node_modules/on-finished/index.js:169:15) at onFinish (/home/ubuntu/mooKIT_server/node_modules/on-finished/index.js:100:5)

KennethanCeyer commented 6 years ago

4 PR have been merged

and this issue seem be fixed I will check again right now. Once i have confirmed that the bug has been fixed, this issue will be closed.