Giter Site home page Giter Site logo

Comments (12)

maxdeviant avatar maxdeviant commented on May 30, 2024 2

@Urwa9550 Could you let me know what version of the library you are seeing the error with?

Note that as of v5.0.0 the package is ESM only: https://github.com/maxdeviant/redux-persist-transform-encrypt/releases/tag/v5.0.0

from redux-persist-transform-encrypt.

radelcom avatar radelcom commented on May 30, 2024 1

also seeing this error. jest unit testings is also complaining about

Cannot find module 'redux-persist-transform-encrypt'

from redux-persist-transform-encrypt.

ThushalIntervest avatar ThushalIntervest commented on May 30, 2024 1

same issue when updated to 3.0.1 -> 5.0.0
Any one has a solution?

from redux-persist-transform-encrypt.

maxdeviant avatar maxdeviant commented on May 30, 2024

also seeing this error. jest unit testings is also complaining about

Cannot find module 'redux-persist-transform-encrypt'

Jest does not natively support ESM.

There is experimental support: https://jestjs.io/docs/ecmascript-modules

from redux-persist-transform-encrypt.

radelcom avatar radelcom commented on May 30, 2024

also seeing this error. jest unit testings is also complaining about

Cannot find module 'redux-persist-transform-encrypt'

Jest does not natively support ESM.

There is experimental support: https://jestjs.io/docs/ecmascript-modules

thanks @maxdeviant, I'll take a look at that link. However, I am also seeing OPs issue when trying to run the app locally. Do we need to configure something in the react-native side to get ESM module to work?

from redux-persist-transform-encrypt.

jackkrone avatar jackkrone commented on May 30, 2024

Had the same issue with v5. Now using 3.0.1 without issue

from redux-persist-transform-encrypt.

apbarratt avatar apbarratt commented on May 30, 2024

Hi guys, I've create a PR with a change that fixed this for us, however, I don't think it's really the correct solution.

The trouble we're having comes from Metro, where it states that the package.json file for this package specifically has a "main": "index.js",, which is not true. It now uses esm module stuff.

So my "fix" is to just add in "main": "lib/index.js", which solves the problem, but I just don't have enough knowledge of esm module stuff to know if this might become a hinderence elsewhere. Especially given this really sounds more like an issue with packages such as metro than anything else.

In the mean time, the true fix we are using right now is to import the library directly using
import { encryptTransform } from 'redux-persist-transform-encrypt/lib'; (note the /lib on the end)

from redux-persist-transform-encrypt.

apbarratt avatar apbarratt commented on May 30, 2024

Here is a screenshot of the error that we get on our phones when we load this on iOS (I'm told it's happening on Android too, but I haven't set up my android build environment quite yet). Curiously the bundle builds just fine for web using metro as usual.
IMG_1437

from redux-persist-transform-encrypt.

apbarratt avatar apbarratt commented on May 30, 2024

I figured I'd check another package and the natural choice was redux-persist

There the package.json does indeed contain both module and main lines. So perhaps I'm on the right track after all.

{
  "name": "redux-persist",
  "version": "6.0.0",
  "description": "persist and rehydrate redux stores",
  "main": "lib/index.js",
  "module": "es/index.js",
  "types": "./types/index.d.ts",
  "repository": "rt2zz/redux-persist",
  ...

from redux-persist-transform-encrypt.

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.