How do I use the @microsoft/microsoft-graph-client as a chrome extension?

Alasdair Kite 20 Reputation points
2023-07-25T10:43:43.81+00:00

I am trying to call the Microsoft Graph API so that I can send a message in an application that is being designed to work as a Chrome Extension. It uses the import statement:

import {ClientOptions} from "@microsoft/microsoft-graph-client";

Despite having tried multiple implementations I get the following error in the browser console:

Uncaught TypeError: Failed to resolve module specifier "@microsoft/microsoft-graph-client". Relative references must start with either "/", "./", or "../".

How am I supposed to be able to resolve and use a graph client in an extension or browser if I am unable to import the node_module into the project?

Thank you,

Alasdair

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.