Skip to content

React Native Crypto Dependency Error #79

Open
@amrmelsayed

Description

@amrmelsayed

I am trying to run the typescript-sdk in a React Native / Expo environment using the Metro bundler, I got a build error due to the package's reliance on crypto:

The package at "apps/dojo-rn/node_modules/@ag-ui/langgraph/dist/index.js" attempted to import the Node standard library module "crypto".
It failed because the native React runtime does not include the Node standard library.

Unable to resolve module crypto from /ag-ui/node_modules/@ag-ui/ langgraph/dist/index.js: crypto could not be found within the project or in these directories:
node_modules
••/••/ node_modules
1 | "use strict";var
N=Object defineProperty, ct=Object.defineP roperties, ut=0bject.getOwnPropertyDescrip tor, gt=0bject.getOwnPropertyDescriptors,p t=Object.getOwnPropertyNames, q=0bject.get
OwnPropertySymbols; var
Z=Object.prototype.has0wnProperty,mt=Obje
ct. prototype.propertyIsEnumerable;var z=(n, t)=> (t=Symbol[n])?
t: Symbol. for ("Symbol."+n) ;var Q=(n, t, e)=>t in n?N(n, t, {enumerable:!
0, configurable: !0, writable:!
0, value:e}) :n[t]=e, g=(n, t)={for(var e in
t|l
(t=1)) )Z. call(t, e)&&Q(n,e, tle]);if(q)for(
var e of
q (t) )mt. call(t, e)&&Q(n, e, t[el); return
n}, y=(n, t)=>ct(n,gt(t)) ;var
Et=(n, t)=>{for(var e in t)N(n, e,
{get :t[el, enumerable:!
0})}, vt=(n,t, e, s)=>{if(t&&typeof
t=="object"||typeof t=="function") for(let
a of pt(t))!.call(n, a)&&a!==e&&N(n,a,
{get: ()=>t[a], enumerable:! (s=ut(t,a))||
s. enumerable});return n};var
St=n=>vt(N({},"__esModule", {value:!
0}), n); var
tt=(n,t, e)=>(t=n[z("asyncIterator")])?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions