Comments (19)
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.
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.
@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.
@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.
"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.
@mweststrate let me look into it.
from mobx-react.
@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.
from mobx-react.
from mobx-react.
@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.
Also, switching back to "mobx-react": "^6.3.0"
and "mobx": "^6.0.0"
doesn't trigger the error.
from mobx-react.
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.
@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.
from mobx-react.
@mweststrate I meant "mobx": "^5.15.7"
instead of "mobx": "^6.0.0"
. My bad.
from mobx-react.
from mobx-react.
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.
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.
Closing until more info becomes available
from mobx-react.
Related Issues (20)
- upgrade mobx-react version from 6.2.2 to 6.2.3,There is an error HOT 7
- observer component re-renders even though observed value doesn't change HOT 4
- build 6.2.4 is broken (missing files) HOT 1
- [mobx-react 6.2.4] Unable to resolve path to module 'mobx-react' HOT 2
- Why not copy static propertities in prototype ? HOT 1
- Attempted import error: 'observerBatchingOptOut' is not exported from 'mobx-react-lite'. HOT 9
- Uncaught TypeError: Cannot add property Symbol(isMobXReactObserver), object is not extensible HOT 2
- New version is breaking previous versions (Error: mobx-react-lite@3 requires mobx at least version 6 to be available) HOT 5
- Problem with version 6.3.0 and mobx v5 HOT 11
- Document `enableStaticRendering` HOT 5
- The problem of `useRef` to keep the store instance HOT 2
- What is the best way to deal with large and dynamic FlatLists? HOT 3
- mobx-react.js.org dead? HOT 1
- deepEqual condition for re-rendering? HOT 9
- observer does not re-render components in React Native HOT 10
- observer doesn't re-render functional components HOT 2
- Not working in nextjs using mobx:6.0.1 HOT 2
- Incosistencies in mobx-react dependency versions. HOT 1
- Migration guide for mobx6 + mobx-react7? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mobx-react.