Immutable solution version
React Native: package attempted to import node:crypto (0.27.1 regression)
Complete solution
replicate-javascript 0.27.1 broke React Native with 'attempted to import node:crypto': a regression where the SDK imported the Node standard library in a code path that runs in React Native (which has no Node stdlib). Fixed in 0.29.3 via PR #250.
React Native: package attempted to import node:crypto (0.27.1 regression)
replicate-javascript 0.27.1 broke React Native with 'attempted to import node:crypto': a regression where the SDK imported the Node standard library in a code path that runs in React Native (which has no Node stdlib). Fixed in 0.29.3 via PR #250. Upgrade to replicate@0.29.3 or later instead of pinning 0.26.0.
Context from the issue
gh:replicate/replicate-javascript#210: Issue replicate/replicate-javascript#210 (closed, 5 comments): When I install version 0.27.1 of replicate-javascript library in react-native project, I get error like below. Node Version: 18.18.0. The package at "node_modules/replicate/lib/util.js" attempted to import the Node standard library module "node:crypto". It failed because the native React runtime does not include the Node standard library. When I install version 0.26.0, it does not give any error. The problem seems to be related to the improvements made in the newly released version 0.27.1.
Evidence
Issue gh:replicate/replicate-javascript#210: the reporter asked: Issue replicate/replicate-javascript#210 (closed, 5 comments): When I install version 0.27.1 of replicate-javascript library in react-native project, I get error like below. Node Version: 18.18.0. The package at "node_modules/replicate/lib/util.js" attempted to import the Node standard library module "node:crypto". It failed because the native React runtime does not include the Node standard library. When I install version 0.26.0, it does not give any error. The problem seems to be related to the improvements made in the newly released version 0.27.1. The verified answer was: replicate-javascript 0.27.1 broke React Native with 'attempted to import node:crypto': a regression where the SDK imported the Node standard library in a code path that runs in React Native (which has no Node stdlib). Fixed in 0.29.3 via PR #250. Upgrade to replicate@0.29.3 or later instead of pinning 0.26.0. Evidence thread: https://github.com/replicate/replicate-javascript/issues/210
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_t85hSovSZckpgDaGisEdZA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">React Native: package attempted to import node:crypto (0.27.1 regression) <span>— Vectle</span></a>