Javascript error "cannot read property scopes of undefined: Sharepoint External Data Source With Authentication

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
I am attempting to interact with Sharepoint Online using OAuth authentication.  When setting up a model, a javascript exception is encountered when a "lookup" is being performed on the External Object Name.

Uncaught TypeError: Cannot read property 'scopes' of undefined

I'm not sure if I have the Authentication configured incorrectly, the model service configured incorrectly or if this is a bug.  Based on reviewing the code, it appears this might be a bug but I wouldn't be surprised if it's a config issue on my end.  The sharepoint tutortial doesn't cover authentication setup and troubleshooting the different layers is difficult without documentation to cover all the possible settings.

The following line of code is where the exception occurs.  If I'm reading the code correctly, authenticate is called without passing any parameters therefore b & c are both undefined which results in the exception on "b.scopes".

skuid__SkuidJS:
r = (c && c.scopes ? c.scopes : b.scopes || "").split(",")

I've granted login access and will email support the Org ID.

Thank you!

Photo of Barry Schnell

Barry Schnell, Champion

  • 18,146 Points 10k badge 2x thumb

Posted 3 years ago

  • 1
Photo of J.

J., Official Rep

  • 7,714 Points 5k badge 2x thumb
Barry,

Yep, this looks like a bug to me. I added a simple truthy check on "b" locally, and then I get the OAuth popup. I'll take a closer look in our Dev Org now and we'll try to get the issue patched up as quickly as possible.
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,146 Points 10k badge 2x thumb
Awesome, thanks J!
Photo of J.

J., Official Rep

  • 7,714 Points 5k badge 2x thumb
Official Response
Barry,

Good news: this will be fixed in Banzai Update 6. Thanks again for helping us track down issues like this!
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,146 Points 10k badge 2x thumb
That's better than good, thanks J!
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,146 Points 10k badge 2x thumb
Tested and confirmed as resolved as of Skuid 7.27 (Update 6).  Thank you!
Photo of J.

J., Official Rep

  • 7,714 Points 5k badge 2x thumb
Great! Thanks for confirming that for us (even before I got back around to responding "Hey, the fix is out!" on this thread!).
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,146 Points 10k badge 2x thumb
Thank you J!