Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.09k stars 1.2k forks source link

Unable to use Identity in react-native #31713

Open Chandanyadav opened 1 week ago

Chandanyadav commented 1 week ago

Describe the bug In our Node.js application, we are utilizing the Azure Identity. However, upon running the server, I encounter the following issue within the Azure Identity package:

`/node_modules/@azure/identity/dist/index.js: child_process could not be found within the project or in these directories: node_modules ../../node_modules 15 | var promises = require('fs/promises'); 16 | var https = require('https');

17 | var child_process = require('child_process'); | ^ 18 | var crypto = require('crypto'); 19 | var util = require('util'); 20 | var open = require('open'); `

I've located the file responsible for the error within the node_modules directory. This file contains the following code at the beginning:

`'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var msalCommon = require('@azure/msal-node'); var logger$o = require('@azure/logger'); var abortController = require('@azure/abort-controller'); var coreUtil = require('@azure/core-util'); var coreClient = require('@azure/core-client'); var coreRestPipeline = require('@azure/core-rest-pipeline'); var coreTracing = require('@azure/core-tracing'); var fs = require('fs'); var os = require('os'); var path = require('path'); var promises = require('fs/promises'); var https = require('https'); var child_process = require('child_process'); var crypto = require('crypto'); var util = require('util'); var open = require('open'); `

Screenshots

Image

github-actions[bot] commented 1 week ago

@deyaaeldeen @jeremymeng @joheredi @maorleger @mpodwysocki @timovv @xirzec

github-actions[bot] commented 1 week ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.

jeremymeng commented 6 days ago

I don't think we support @azure/identity on react-native yet. One of the reasons was that our dependency msal-node didn't provide good support either.

xirzec commented 6 days ago

@KarishmaGhiya are there auth flows we expect to work inside React Native?

Chandanyadav commented 6 days ago

Do we have any alternate approach to sending events to event-hubs in React native? (https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-node-get-started-send?tabs=passwordless%2Croles-azure-portal)

jeremymeng commented 5 days ago

Do we have any alternate approach to sending events to event-hubs in React native? (https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-node-get-started-send?tabs=passwordless%2Croles-azure-portal)

@Chandanyadav you should probably log a new issue as this is for @azure/identity. It is possible to send events via REST api https://learn.microsoft.com/en-us/rest/api/eventhub/. I also have been working on a prototype of client SDK for that. Note that consuming is not supported via REST.