Embarking on my inaugural project with Next.js, I find myself in unfamiliar territory. Rather than joining existing projects, I am constructing apps from scratch, encountering a challenge with Azure Identity along the way. Upon delving into the node modules, it appears that the framework is gravitating towards browserflow instead of nodeflow.
Here's an overview of my file structure:
- project
- pages
- api
- _middleware: invoking util function
- api
- util
- utility function for accessing azure key vault
- pages
The specific error message reads as follows: error - (middleware)\node_modules@azure\identity\dist-esm\src\msal\browserFlows\msalAuthCode.js (8:0) @ TypeError: Cannot read property 'hash' of undefined
On line 8, you'll find this code snippet:
const redirectHash = self.location.hash;
Do I need to tweak any configurations to prevent Identity from triggering browserflow? Is there a specific structural paradigm I should adhere to? Your guidance would be greatly valued!
Edit: The issue seems related to invoking the function within the middleware. While utilizing another function from the same util file in an endpoint yields no problems, calling it in the middleware leads to complications.