5

I get this error: "Either Guest user or Cortex is not enabled!" in the browser's developer console when I run my published webpart. It first appeared around October 26th 2022.

enter image description here

The error type is "unhandledrejection". When I run it on the workbench on the same tenant, I don't get this error. This seems to be an error caused on the SP Page by something from "Cortex", which I just learned is some kind of AI tool by Microsoft.

By analyzing the sp-pages-assembly script I can see the error being thrown according to some logic that is hard to understand from the outside.

Any clue on what this is and how it can be resolved would be appreciated :)

Vincent Gagnon
  • 151
  • 1
  • 3

1 Answers1

0

This is an issue with PnP js not being configured correctly, or at least that was the issue for me. In the main ts file that gets created when the web part gets scaffolded; make sure that on your init function you add the get SP object function and pass the current context for it. For my pnpjs config file I have a function called getSP... so in my wepartnameWebPart.ts on the init function I add getSP(this.context).

esteuardo
  • 11
  • 3