question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to resolve module `crypto` from `node_modules/typeorm/browser/util/StringUtils.js`

See original GitHub issue

Issue type:

[ ] question [x] bug report [ ] feature request [ ] documentation issue

Database system/driver:

[ ] cordova [ ] mongodb [ ] mssql [ ] mysql / mariadb [ ] oracle [ ] postgres [ ] cockroachdb [ ] sqlite [ ] sqljs [x] react-native [ ] expo

TypeORM version:

[ ] latest [ ] @next [x] 0.2.22 (this is the latest at this moment)

When using with React Native I’m getting “Unable to resolve module crypto” error when trying to use TypeORM. The issue appears in the 0.2.22 only. This is due to the following recent change: https://github.com/typeorm/typeorm/commit/edc8e6dfd2c250656ab5b143297c60f57787ce77#diff-3fbb9e2b917220327e7c2fe6522c9b6d

Steps to reproduce or a small repository showing the problem:

react-native init TypeormHash cd TypeormHash Add "import {Entity} from 'typeorm/browser';" at the top of App.js react-native run-android

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

8reactions
nochkincommented, Dec 24, 2019

I guess this is open for discussions as I’m not sure this is the right approach. My own fix is to use sha.js instead of “crypto” which is not available in RN: https://github.com/nochkin/typeorm/commit/ba160304f89e8a533b075d4af9961066a09bd05a I can make a PR if this is acceptable.

2reactions
sallarcommented, Jan 26, 2020

Can we have a release please? The latest version is broken on React Native.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to resolve module crypto in reactnative - Stack Overflow
Crypto is a node js module, when React Native is run - it uses Javascript Core. Crypto isn't include within this. When I...
Read more >
Unable to resolve module crypto - DEV Community ‍ ‍
Solution · Step 1: eject expo · Step 1.5: run app in simulator via xcode · Step 2: install package rn-nodeify · Step...
Read more >
Error: Unable to resolve module crypto from #273 - GitHub
This is in an Angular 9 project. The crypto module is available in node: % node Welcome to Node.js v12.16.1. Type ".help" for ......
Read more >
Can't resolve 'crypto' in node_modules/bson/dist react
I'm using realm-web on my react app to build a simple task reminder app. But, when I start/build the app it is giving...
Read more >
Moralis React Native, Crypto Dep Error
npm install crypto-js ... var CryptoJS = require('crypto-js'); ... Unable to resolve module https, I dont think moralis is working with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found