AzureAD / microsoft-authentication-library-for-js

Microsoft Authentication Library (MSAL) for JS
http://aka.ms/aadv2
MIT License
3.64k stars 2.65k forks source link

Failed to resolve entry for package "@azure/msal-browser". The package may have incorrect main/module/exports specified in its package.json. #6853

Closed giuliohome closed 8 months ago

giuliohome commented 8 months ago

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

latest

Wrapper Library

MSAL Node Extensions (@azure/msal-node-extensions)

Wrapper Library Version

latest

Public or Confidential Client?

Public

Description

The following error when I npm install and npm run the vue 3 browser sample

Failed to resolve entry for package "@azure/msal-browser". The package may have incorrect main/module/exports specified in its package.json.

Error Message

Failed to resolve entry for package "@azure/msal-browser". The package may have incorrect main/module/exports specified in its package.json.

MSAL Logs

No response

Network Trace (Preferrably Fiddler)

MSAL Configuration

authConfig.ts of the vue sample, edited with the needed values

Relevant Code Snippets

npm i
npm start

Reproduction Steps

npm i npm start

Expected Behavior

run without the error

Identity Provider

Entra ID (formerly Azure AD) / MSA

Browsers Affected (Select all that apply)

Chrome

Regression

No response

Source

External (Customer)

giuliohome commented 8 months ago

this is is about vue sample in samples/msal-browser-samples/vue3-sample-app

giuliohome commented 8 months ago

Tried also with yarn 4 stable https://yarnpkg.com/ instead of npm but same error

Then tried again with

Tried with

nvm install lts/hydrogen

but no luck

giuliohome commented 8 months ago

Solved by myself by copying the sample folder out of the repo root in a new folder where I did

npm init 
npm install @azure/msal-browser@latest 

and then copied the sample folder from this repo there In this way

npm i 
npm start 

worked!

Yet another solution:

npm run build:package 

😸