Giter Site home page Giter Site logo

Comments (11)

calvinmetcalf avatar calvinmetcalf commented on August 16, 2024

how exactly are you importing this? are you doing

var crypto = require('browserify-crypto');

because last I checked react-native doesn't include this by default

from pbkdf2.

dnson avatar dnson commented on August 16, 2024

@calvinmetcalf
I used the babel-plugin-rewrite-require to do that
sth like this:
image

from pbkdf2.

calvinmetcalf avatar calvinmetcalf commented on August 16, 2024

so it sounds like that's not working, right, you may want to trouble shoot with the plugin

from pbkdf2.

calvinmetcalf avatar calvinmetcalf commented on August 16, 2024

actually the issue you have is that it isn't grabbing the browser version of packages like it should and is instead grabbing the nodejs version which assumes there is already a crypto object available and just tries to augment it

from pbkdf2.

dnson avatar dnson commented on August 16, 2024

@calvinmetcalf I think we need to improve this crypto.pbkdf2Sync.toString().indexOf('keylen, digest') === -1. Because sth like when you import to react-native, the code will be minified so it will throw error

from pbkdf2.

calvinmetcalf avatar calvinmetcalf commented on August 16, 2024

so the issue is that it shouldn't be loaded in the first place but whatever your config is isn't respecting the browser field in the package.json

from pbkdf2.

dnson avatar dnson commented on August 16, 2024

I mean that 'keylen, digest' will be minified so it will be sth like a,b

from pbkdf2.

calvinmetcalf avatar calvinmetcalf commented on August 16, 2024

again, the fact that you are loading that file while not in node in the first place is a bug but it can't hurt to fail better in that case, see #71

from pbkdf2.

fryck avatar fryck commented on August 16, 2024

The problem is, in react native app, index.js is use instead of browser version. I have no problem with another npm packages

from pbkdf2.

lnaalisv avatar lnaalisv commented on August 16, 2024

We have a typescript project and we use karma + phantomjs for our unit tests. However when trying to update typescript version our tests break because of this. Removing the if- check from the pdkf2-module makes tests work normally again.

from pbkdf2.

calvinmetcalf avatar calvinmetcalf commented on August 16, 2024

should be fixed and published

from pbkdf2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.