Skip to content

ReferenceError: Request is not defined #189

@dejue

Description

@dejue

Description

When using the MS Graph Client Library v1.7.0, we're not seeing any request being sent to https://graph.microsoft.com/v1.0/me.

We're doing the following:

  1. We downloaded sample code.
  2. We installed npm packages
  3. We updated the MS App ID, MS App Password, and the Connection Name in the .env file
  4. We ran the code locally

Expected behavior:
When sending "me", we expect to see a call being made out to the Graph API to retrieve the information we're seeing at the Graph Explorer.

Actual behavior:
When sending "me", we are going to GraphRequest.prototype.get which is then calling GraphRequest.prototype.send and finally returning to HTTPClient.prototype.sendRequest. However, when looking through Fiddler, we're not seeing any request being made to https://graph.microsoft.com/v1.0/me and we're getting a ReferenceError: Request is not defined exception at tslib.js.

\node_modules@microsoft\microsoft-graph-client\lib\src\GraphRequest.js
image
image

Once we enter the GraphRequest.prototype.send method, this fails immediately and complains about the request object. From the comments, we know that the request is a request USL string or the request object value. From live debugging, the request is passing in "https://graph.microsoft.com/v1.0/me". Why is this URL not accepted here?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions