From 9f53f36403e633b573f051f318f5f00855575277 Mon Sep 17 00:00:00 2001 From: Lewis Ellis Date: Thu, 23 Feb 2017 00:36:36 -0800 Subject: [PATCH] Add alert about node vs raven-js when it seems like a browser env --- lib/client.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/client.js b/lib/client.js index 7b58acf..d04e735 100644 --- a/lib/client.js +++ b/lib/client.js @@ -23,6 +23,11 @@ nodeUtil.inherits(Raven, events.EventEmitter); extend(Raven.prototype, { config: function config(dsn, options) { + // We get lots of users using raven-node when they want raven-js, hence this warning if it seems like a browser + if (typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined') { + utils.consoleAlert('This looks like a browser environment; are you sure you don\'t want Raven.js for browser JavaScript? https://sentry.io/for/javascript'); + } + if (arguments.length === 0) { // no arguments, use default from environment dsn = process.env.SENTRY_DSN;