Unable to import `TokenCredentialAuthenticationProvider` with ESM
@koros ci sta già lavorando.
Dal 7/8/2023.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Bug Report
Unable to use TokenCredentialAuthenticationProvider with ESM
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
Importing TokenCredentialAuthenticationProvider and running in node 18 fails.
Console Errors:
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import 'C:\Users\erikm\projects\graph-repro\node_modules\@microsoft\microsoft-graph-client\authProviders\azureTokenCredentials' is not supported resolving ES modules imported from C:\Users\erikm\projects\graph-repro\dist\index.js
Did you mean to import @microsoft/microsoft-graph-client/authProviders/azureTokenCredentials/index.js?
at new NodeError (node:internal/errors:399:5)
at finalizeResolution (node:internal/modules/esm/resolve:319:17)
at moduleResolve (node:internal/modules/esm/resolve:945:10)
at defaultResolve (node:internal/modules/esm/resolve:1153:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36) {
code: 'ERR_UNSUPPORTED_DIR_IMPORT',
url: 'file:///C:/Users/erikm/projects/graph-repro/node_modules/@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials'
}
Screenshots: [If applicable, add screenshots to help explain your problem]
Steps to Reproduce
- Install
@microsoft/microsoft-graph-client - Set
type: "module"in package.json - Create an index.js file with JUST this:
import { TokenCredentialAuthenticationProvider } from '@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials';
- Run
node index.js
Expected behavior:
The node application should run
Actual behavior:
Errors with
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import
SDK Version -3.0.5
- Node (Check, if using Node version of SDK)
Node Version - v18.16.0
- 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]
- Lingua principale
- TypeScript
- Stelle
- 833
- Fork
- 240
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoftgraph/msgraph-sdk-javascript
-
status:waiting-for-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
-
Is anyone here? Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 reazione ·
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests? Apertastatus:waiting-for-triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
-
status:waiting-for-triage type:bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 commenti · 1 reazione ·
-
status:waiting-for-triage type:bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Tutte le issue di microsoftgraph/msgraph-sdk-javascript
Issue simili
-
Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenNSW/nsw-srilanka#497 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
0xMiden/bridge-portal#132 ·
-
react-doctor severity:warning tech-debt
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
digidem/comapeo-cloud-app#403 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100