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

Add alert about node vs raven-js when it seems like a browser env #277

Merged
merged 1 commit into from
Feb 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down