-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Cannot find module '@azure/msal-common' #6714
Comments
The code above is from the official documentation: Getting Started |
Double check that @azure/msal-common was actually installed - it's a dependency of msal-browser so should have been. If it is installed, webpack may not be including it in the bundle. That would be something you need to debug with your webpack config. |
Can confirm a similar bug, when following the same instructions found here: Recommendations found in other bug reports suggest installing 'azure/msal-common' directly: But it doesn't fix the issue either. I'd suspect a Node version issue, but that needs to be made clear in the documentation, and ideally, provide a description of a work around, if possible. I'd prefer to see this ticket re-opened, than have to create another similar ticket. As there appear to be a few of the same class on this board (mostly for the Angular version of the library). |
Confirmed, same problem for me. Building an Electron app based off of VueJS. The Microsoft Graph Toolkit docs are utterly useless for Electron right now, and they have some major bugs in the MGT libraries when I try to use them in Electron. Awful experience. I give up the Microsoft Graph Toolkit and decide to take a simple, msal-node approach, and now I'm met with this ridiculous error. I can't win with Microsoft authentication in Electron, it's just horrible. My environment: OS Node versions (both failed): Package.json: {
"dependencies": {
"@auth0/auth0-vue": "^1.0.2",
"@azure/msal-node": "^2.6.2",
"axios": "^0.27.2",
"core-js": "^3.8.3",
"crypto-js": "^4.1.1",
"devextreme": "^22.1.3",
"devextreme-vue": "^22.1.3",
"dotenv": "^16.0.1",
"electron-updater": "^6.1.4",
"jwt-decode": "^3.1.2",
"pinia": "^2.0.16",
"powerbi-client": "^2.21.1",
"sass": "^1.34.1",
"vue": "^3.2.13",
"vue-router": "^4.0.1",
"winston": "^3.8.2",
"winston-daily-rotate-file": "^4.7.1"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"autoprefixer": "^10.4.13",
"devextreme-cli": "1.4.2",
"devextreme-themebuilder": "^22.1.3",
"electron": "22.0.0",
"electron-builder": "^23.6.0",
"electron-devtools-installer": "^3.1.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"postcss": "^8.4.20",
"sass-loader": "^10",
"tailwindcss": "^3.2.4",
"vue-cli-plugin-electron-builder": "~2.1.1"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {
"vue/multi-word-component-names": "off"
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
} |
Hi guys, I also faced this issue, but luckily I had two projects I've been trying to use this on - and in one of them this issue did not occur. Hope this helps! |
Core Library
MSAL.js (@azure/msal-browser)
Core Library Version
3.5.0
Wrapper Library
MSAL React (@azure/msal-react)
Wrapper Library Version
2.0.7
Public or Confidential Client?
Public
Description
For trying purposes, I downloaded these two packages for testing the msal authentication.
I created the simplest React Vite Project. Just by running npm i and then npm run dev I get this error message
Error Message
Uncaught SyntaxError: Unexpected token '!'
!(function webpackMissingModule() { var e = new Error("Cannot find module '@azure/msal-common'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(), parsedAccount);
Msal Logs
No response
MSAL Configuration
Relevant Code Snippets
Reproduction Steps
npm i
npm run dev
Expected Behavior
Run and redirect the user to the MS login page
Identity Provider
Azure AD / MSA
Browsers Affected (Select all that apply)
Chrome
Regression
No response
Source
External (Customer)
The text was updated successfully, but these errors were encountered: