Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'msal' #361

Closed
5 of 6 tasks
whatl3y opened this issue Dec 1, 2020 · 5 comments
Closed
5 of 6 tasks

Error: Cannot find module 'msal' #361

whatl3y opened this issue Dec 1, 2020 · 5 comments

Comments

@whatl3y
Copy link

whatl3y commented Dec 1, 2020

Bug Report

Prerequisites

  • Can you reproduce the problem?
  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you perform a cursory search?

For more information, see the CONTRIBUTING guide.

Description

Building my app in a docker container and running v2.2.0 of @microsoft/microsoft-graph-client in Node.js 14.13.1.

This is a new error that I didn't experience last week when building the container, but I didn't notice any recent changes to package.json or ImplicitMSALAuthenticationProvider.ts that would cause this.

Console Errors: [Is there any console error]

Error: Cannot find module 'msal'
Require stack:
- /usr/app/node_modules/@microsoft/microsoft-graph-client/lib/src/ImplicitMSALAuthenticationProvider.js
- /usr/app/node_modules/@microsoft/microsoft-graph-client/lib/src/index.js

Screenshots: [If applicable, add screenshots to help explain your problem]

N/A

Steps to Reproduce

  1. Add @microsoft/microsoft-graph-client to your Node.js project.
  2. import { Client } from '@microsoft/microsoft-graph-client' from a file in your project
  3. See error

Expected behavior: [What you expected to happen]

Not error

Actual behavior: [What actually happened]

Error above

Additional Context

Add any other context about the problem here..

Usage Information

SDK Version - [SDK version you are using]

v2.2.0

  • Node (Check, if using Node version of SDK)

Node Version - [The version of Node you are using]

14.13.1

  • Browser (Check, if using Browser version of SDK)

Browser Name - [The name of Browser that you are using for SDK]

Version - [The version of the browser you are using]

@ghost ghost added the ToTriage label Dec 1, 2020
@whatl3y
Copy link
Author

whatl3y commented Dec 1, 2020

Adding msal to my app's package.json dependencies (npm install -s msal) temporarily resolves this, but that's not a long term solution obviously.

@nikithauc nikithauc self-assigned this Dec 1, 2020
@nikithauc
Copy link
Contributor

@whatl3y Thank you for reporting the issue! Will look into the issue.

@nikithauc nikithauc added this to the Hot Fix milestone Dec 1, 2020
@Srokap
Copy link

Srokap commented Dec 1, 2020

Seeing same issue, looks like installed ms graph lib has only those 2 as dpendencies

  "dependencies": {
    "@babel/runtime": "^7.4.4",
    "tslib": "^1.9.3"
  },

And in node_modules/@microsoft/microsoft-graph-client/lib/es/ImplicitMSALAuthenticationProvider.js there is:

import { InteractionRequiredAuthError } from "msal";

on line 11.

Seems to me that msal should be a production dependency unless you meant to make it a peer dependency. Also notice that msal is currently a devDependency, so that's likely why it got missed.

@raimille1
Copy link

raimille1 commented Dec 1, 2020

Same issue here! Took production down, all it took was a redeploy. No library changes or code changes.

This was referenced Dec 1, 2020
@nikithauc
Copy link
Contributor

@whatl3y @Srokap @raimille1 hotfix #362 has been deployed in version 2.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants