Giter Club home page Giter Club logo

Comments (19)

danielkcz avatar danielkcz commented on June 2, 2024 1

What I mean is the assertEnvironment is used by mobx-react-lite internally only. How is it possible something else is importing it from a different path?

from mobx-react.

mweststrate avatar mweststrate commented on June 2, 2024

could you verify in your lockfile / node_modules which version of mobx-react-lite is installed? should be 3.0.0 at least

from mobx-react.

danielkcz avatar danielkcz commented on June 2, 2024

@mweststrate Isn't the path wrong here?

node_modules/mobx-react-lite/es/assertEnvironment

Should be in utils dir ... https://unpkg.com/browse/[email protected]/es/utils/

from mobx-react.

mweststrate avatar mweststrate commented on June 2, 2024

@virtumonde yeah that sounds like you have somehow a hardcoded import into the mobx-react-library somewhere? VSCode tends to do that sometimes :-P. I suspect this issue is further unrelated to the actual package. That file has moved indeed recently, but is internal so should not affect anything.

from mobx-react.

dclipca avatar dclipca commented on June 2, 2024

@mweststrate

    "mobx-react": {
      "version": "7.0.0",
      "resolved": "https://registry.npmjs.org/mobx-react/-/mobx-react-7.0.0.tgz",
      "integrity": "sha512-yxbTG+ovn/GbgF3+QdQahkL5sXiITtwvkoXM6PNqd0V4jvO53cnr/YM4PYuA+0Ig95IW1nojA3qViJx9ufJm6w==",
      "requires": {
        "mobx-react-lite": "^3.0.0"
      }
    },
    "mobx-react-lite": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-3.0.0.tgz",
      "integrity": "sha512-SJgrTD9mfClFOsamB+0y6zjteSMr4gkp9usnpIeEi8E+lW3lMgDa3hnD4PJgLGoENpJ8/9OmO3vrkA50SNy0mw=="
    },

from mobx-react.

dclipca avatar dclipca commented on June 2, 2024

@mweststrate let me look into it.

from mobx-react.

dclipca avatar dclipca commented on June 2, 2024

@mweststrate by hardcoded import you mean I am myself trying to access node_modules/mobx-react-lite/es/index.js? I've scanned my project for this kind of imports and didn't find anything. Let's wait to see if other people encounter this error.

from mobx-react.

mweststrate avatar mweststrate commented on June 2, 2024

from mobx-react.

mweststrate avatar mweststrate commented on June 2, 2024

from mobx-react.

dclipca avatar dclipca commented on June 2, 2024

@mweststrate the only mention of mobx-react-lite is in my package-lock.json. I am sure that my code does not import it. Maybe other packages might import it? Here are my dependencies:

  "dependencies": {
    "@react-native-community/async-storage": "^1.12.0",
    "@react-native-firebase/app": "^8.4.5",
    "@react-native-firebase/crashlytics": "^8.4.8",
    "@react-native-mapbox-gl/maps": "^8.1.0-rc.4",
    "google-protobuf": "^3.13.0",
    "grpc-web": "^1.2.1",
    "lottie-react-native": "^3.5.0",
    "mobx": "^6.0.0",
    "mobx-react": "^7.0.0",
    "react": "16.13.1",
    "react-native": "0.63.3",
    "react-native-action-button": "^2.8.5",
    "react-native-modal": "^11.5.6",
    "react-native-permissions": "^2.2.2",
    "react-native-popup-menu": "^0.15.9",
    "react-native-safe-area-context": "^3.1.8",
    "react-native-sound": "^0.11.0",
    "react-native-toast-message": "^1.3.3",
    "react-native-vector-icons": "^7.1.0"
  },
  "devDependencies": {
    "@babel/core": "^7.11.6",
    "@babel/plugin-proposal-class-properties": "^7.10.4",
    "@babel/plugin-proposal-decorators": "^7.10.5",
    "@babel/runtime": "^7.11.2",
    "@react-native-community/eslint-config": "^2.0.0",
    "@types/geojson": "^7946.0.7",
    "@types/jest": "^26.0.14",
    "@types/react-native": "^0.63.23",
    "@types/react-test-renderer": "^16.9.3",
    "@types/uuid-parse": "^1.0.0",
    "@typescript-eslint/eslint-plugin": "^4.3.0",
    "@typescript-eslint/parser": "^4.3.0",
    "@types/google-protobuf": "^3.7.3",
    "@types/react-native-vector-icons": "^6.4.6",
    "babel-jest": "^26.3.0",
    "eslint": "^7.10.0",
    "jest": "^26.4.2",
    "metro-react-native-babel-preset": "^0.63.0",
    "prettier": "^2.1.2",
    "react-test-renderer": "16.13.1",
    "typescript": "^4.0.3"
  }

from mobx-react.

dclipca avatar dclipca commented on June 2, 2024

Also, switching back to "mobx-react": "^6.3.0" and "mobx": "^6.0.0" doesn't trigger the error.

from mobx-react.

danielkcz avatar danielkcz commented on June 2, 2024

Something is apparently importing the old file. Maybe even some sort of cache? Might be even duplicate versions of packages. I recommend deleting node_modules and reinstalling from the scratch.

from mobx-react.

dclipca avatar dclipca commented on June 2, 2024

@FredyC I already did that 5 times. I will look into other possibilities soon as for now this is not critical to me.

from mobx-react.

mweststrate avatar mweststrate commented on June 2, 2024

from mobx-react.

dclipca avatar dclipca commented on June 2, 2024

@mweststrate I meant "mobx": "^5.15.7" instead of "mobx": "^6.0.0". My bad.

from mobx-react.

mweststrate avatar mweststrate commented on June 2, 2024

from mobx-react.

mweststrate avatar mweststrate commented on June 2, 2024

Just for confirmation, I just tried both a fresh CRA and a fresh RN project with mobx@6 + mobx-react@7 and they work fine. So this really seems to be a local issue. You can try to run yarn why mobx-react-lite (or the other 2) to see if another package accidentally brings a different version of those packages.

from mobx-react.

mweststrate avatar mweststrate commented on June 2, 2024

Healthy output looks like:

yarn why mobx-react-lite
yarn why v1.22.4
[1/4] 🤔  Why do we have the module "mobx-react-lite"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
   - "mobx-react" depends on it
   - Hoisted from "mobx-react#mobx-react-lite"
info Disk size without dependencies: "316KB"
info Disk size with unique dependencies: "316KB"
info Disk size with transitive dependencies: "316KB"
info Number of shared dependencies: 0
✨  Done in 0.48s.

from mobx-react.

mweststrate avatar mweststrate commented on June 2, 2024

Closing until more info becomes available

from mobx-react.

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.