Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
Why is Azure Identity using Browserflow instead of the nodeflow in my Next js app?

This is my first project using Next js and I am fairly new to building apps from the ground up like this instead of just tagging on to existing projects. I am getting an error from Azure Identity and I traced it back through the node modules. It looks like its trying to use the browserflow instead of the nodeflow.

Here is my file structure:

  • project
    • pages
      • api
        • _middleware: calling util function
    • util
      • util function to access azure key vault

The exact error: error - (middleware)\node_modules@azure\identity\dist-esm\src\msal\browserFlows\msalAuthCode.js (8:0) @ TypeError: Cannot read property 'hash' of undefined

Line 8 is as follows: const redirectHash = self.location.hash;

Is there a configuration I need to check to make sure Identity doesn't trigger browserflow? Is there a different structure I need to follow? Any help would be appreciated!

Edit: So it seems to have something to do with calling the function in the middleware. I can use another function in that util file within an endpoint and it works fine, its just calling it in the middleware that causes the issue.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

So i cross posted this with Next Js' github discussion board and one of the maintainers replied with the following: "Hi, this is because Middleware is run in the Edge Runtime, which is closer to the Browser environment in terms of APIs. (since browsers are following the standard Web APIs)"

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!