Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q.includePaths.test is not a function #377

Closed
namxam opened this issue Sep 10, 2015 · 14 comments · Fixed by #382
Closed

Q.includePaths.test is not a function #377

namxam opened this issue Sep 10, 2015 · 14 comments · Fixed by #382

Comments

@namxam
Copy link

namxam commented Sep 10, 2015

I am getting the following error in raven.js. I have a hard time debugging it. Any ideas what it triggers?

Raven.js 1.1.20 (568d778)

Uncaught TypeError: Q.includePaths.test is not a function
  p @ raven.js:1644
  (anonymous function) @ raven.js:1603
  m @ raven.js:1583
  o @ raven.js:1602
  X.captureException @ raven.js:1332
  t.default.onerror @ myapp.js:3
  …

Code around line 1644

normalized.in_app = !( // determine if an exception came from outside of our app
    // first we check the global includePaths list.
    !globalOptions.includePaths.test(normalized.filename) ||
    // Now we check for fun, if the function name is Raven or TraceKit
    /(Raven|TraceKit)\./.test(normalized['function']) ||
    // finally, we do a last ditch effort and check for raven.min.js
    /raven\.(min\.)?js$/.test(normalized.filename)
);
@mattrobenolt
Copy link
Contributor

Hmm, could you give me information on how you triggered this? And does it happen with 1.1.19?

@mattrobenolt
Copy link
Contributor

The only way I could see that happening is if you didn't call Raven.config. In there is where it gets initialized as a RegExp object.

@mattrobenolt
Copy link
Contributor

Or it's some weird browser specific bug. So that information is useful. :)

@hughes
Copy link

hughes commented Sep 12, 2015

I also noticed this today. Confirmed 1.1.19 works and 1.1.20 is broken, using the PhantomJS 1.9.8 browser.

TypeError: 'undefined' is not a function (evaluating globalOptions.includePaths.test(normalized.filename)')

@mattrobenolt
Copy link
Contributor

@hughes Can you reproduce this reliably in a way that I can debug?

@mattrobenolt
Copy link
Contributor

I'm really at a loss here since I can't see any way this happens unless Raven.config() doesn't succeed.

@hughes @namxam Can you confirm what you're passing through Raven.config() ?

This could only happen if you passed a falsey value to Raven.config().

https://github.com/getsentry/raven-js/blob/master/src/raven.js#L71

Then at that point, globalOptions.includePaths will still be an Array instead of the expected RegExp object.

@hughes
Copy link

hughes commented Sep 12, 2015

A few more details:

  • This is happening in my integration tests, where I don't actually call Raven.config since I don't need error reporting. Maybe what's most unexpected here is that raven is doing anything at all
  • The angular-raven package is present in the app

@mattrobenolt
Copy link
Contributor

Ok, so I can reproduce that way.

If I don't call Raven.config() anywhere, but proceed to use Raven.captureException(...), it throws this.

Lemme see what's wrong.

@hughes
Copy link

hughes commented Sep 12, 2015

Yeah, angular-raven will run exceptions through Raven.captureException regardless of whether raven has been configured.

@mattrobenolt
Copy link
Contributor

Yeahhh, I'm seeing now. I'm going to fix tonight for sure.

Thanks for helping me track down.

@mattrobenolt
Copy link
Contributor

I pushed a 1.1.21 that should fix this. My apologies. :(

@hughes
Copy link

hughes commented Sep 14, 2015

While the Q.includePaths.test error is now gone, it seems to have been replaced by a problem with globalOptions.ignoreErrors.test(message) at https://github.com/getsentry/raven-js/blob/master/src/raven.js#L618

Uncaught TypeError: globalOptions.ignoreErrors.test is not a function

@hughes
Copy link

hughes commented Sep 14, 2015

Raven.captureException('foo') -> shows Error: Raven has not been configured.

Raven.captureException(new Error('foo')) -> shows Uncaught TypeError: globalOptions.ignoreErrors.test is not a function

@mattrobenolt
Copy link
Contributor

wtf, I swear I tested this. :(

mattrobenolt added a commit that referenced this issue Sep 15, 2015
mattrobenolt added a commit that referenced this issue Sep 15, 2015
Handle other cases of unintialized RegExp objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants