-
-
Notifications
You must be signed in to change notification settings - Fork 903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not Compatible with React Native #408
Comments
In version 7 of UUID we have deprecated the direct imports. Instead of importing from import { v1 as uuidv1 } from 'uuid'
uuidv1() // ⇨ '2c5ea4c0-4067-11e9-8b2d-1b9d6bcdbbfd' |
As commented by @LinusU, deep requires are deprecated. It was indeed unintended that we actually broke them for non-node environments, but we will probably not change that. See https://github.com/uuidjs/uuid#deep-requires-now-deprecated for more information. |
This breaks before the import though. |
It probably breaks when constructing the dependency tree, but if you change the import that should fix it. Did you try to change the import? |
Hmm, we could use https://github.com/TooTallNate/util-deprecate 🤔 |
Yeah, I tried that import but still getting the same error, does this require installing pods? |
@judygab did follow the polyfilling instructions from https://github.com/LinusU/react-native-get-random-values#readme ? What does your exact import code look like? |
Hello, I just discovered your module and I am using react-native. My target are iOS, Android and web, this is my import: import { v4 as uuidv4 } from 'uuid'; It work fine with iOS and Android, but I have the following new error on the web:
There's obviously something wrong with I am using uuid v7.0.2, any idea how I can fix this? |
@kopax Can you clear all build caches/node_modules directories/etc. and try again? This looks like some legacy code survived the upgrade and not like a problem with the In particular, search your code base for |
@ctavan your assertion is wrong, I have never used your module before. I never heard of it before today when I was looking for a solution on how to get a filename for pictures taken with the webcam/camera in expo SDK36. I did test-native@1.1.0 /home/dka/workspace/test-native
├─┬ @expo/webpack-config@0.11.3
│ └─┬ copy-webpack-plugin@5.0.0
│ └─┬ webpack-log@2.0.0
│ └── uuid@3.4.0
├─┬ @rollup-umd/documentation@2.1.1
│ ├─┬ image-webpack-loader@6.0.0
│ │ └─┬ imagemin-gifsicle@6.0.1
│ │ └─┬ exec-buffer@3.2.0
│ │ └─┬ tempfile@2.0.0
│ │ └── uuid@3.4.0
│ └─┬ react-styleguidist@9.1.2
│ └─┬ webpack-dev-server@3.10.3
│ └─┬ sockjs@0.3.19
│ └── uuid@3.4.0
├─┬ @semantic-release/npm@7.0.4
│ └─┬ npm@6.14.2
│ ├─┬ request@2.88.0
│ │ └── uuid@3.3.3 deduped
│ └── uuid@3.3.3
├─┬ @yeutech-lab/expo-cli@3.12.1-fix-1405.4
│ ├─┬ @expo/build-tools@0.1.3
│ │ └── uuid@3.4.0
│ ├─┬ @expo/bunyan@3.0.2
│ │ └── uuid@3.4.0
│ ├─┬ @expo/dev-tools@0.10.1
│ │ └─┬ graphql-tools@3.0.0
│ │ └── uuid@3.4.0
│ ├─┬ @expo/xdl@57.5.1
│ │ ├─┬ @expo/ngrok@2.4.3
│ │ │ └── uuid@3.4.0
│ │ ├─┬ analytics-node@3.3.0
│ │ │ └── uuid@3.4.0
│ │ ├─┬ raven@2.6.3
│ │ │ └── uuid@3.0.0
│ │ ├─┬ slugid@1.1.0
│ │ │ └── uuid@2.0.3
│ │ ├── uuid@3.3.2
│ │ └─┬ xcode@2.1.0
│ │ └── uuid@3.4.0
│ ├─┬ match-require@2.1.0
│ │ └── uuid@3.4.0
│ └─┬ request@2.88.0
│ └── uuid@3.4.0
├─┬ expo-cli@3.13.5
│ ├─┬ @expo/build-tools@0.1.4
│ │ └── uuid@3.4.0
│ └─┬ @expo/xdl@57.5.4
│ └── uuid@3.3.2
├─┬ jsdom@16.2.1
│ └─┬ request@2.88.2
│ └── uuid@3.4.0
└── uuid@7.0.2 Looking at my
|
Some module may not list its uuid in dependencies and use the root one instead. This might trigger warning. Try to add console.trace in uuid/v4.js to see which module trigger this. |
../../../uuid/v4.js | @ | bundle.js:formatted:251948
-- | -- | --
| __webpack_require__ | @ | bundle.js:formatted:1460
| fn | @ | bundle.js:formatted:253
| ../../../expo-constants/build/ExponentConstants.web.js | @ | bundle.js:formatted:96205
| __webpack_require__ | @ | bundle.js:formatted:1460
| fn | @ | bundle.js:formatted:253
| ../../../expo-constants/build/Constants.js You're assertion is correct, it is happening here : https://github.com/expo/expo/blob/master/packages/expo-constants/src/ExponentConstants.web.ts#L2 Any idea how I can fix this? am I subject to breaking expo by leaving this? I believe not, it's just a warning for the import, it would be nice to be able to downgrade the warning so we can perform the upgrade without adding more warning to our apps. I am noww choosing to dowgrade my uuid version to v3.4.0 to remove those warnings. |
Looks like they fixed this in master. Need to ping them to publish new version. |
I have checked the commit and the PR title is a bit confusing... How did they "make it work"? Did they just removed it? |
Thanks for the link.
Expo is not publishing often so I'll just stay with v3.4.0 till they upgrade. I believe this will still do the job. |
I have tried that, didn't work. |
@judygab maybe you're having the same issue as #408 (comment) ? |
@ctavan I don't think so, I'm not using Expo. |
Any package may forget to add uuid to dependencies. Try to add console.trace too. |
Agreed, but this was not happening until I installed uuid specifically. |
@judygab I think that we're not finding a solution to your problem with further guesswork. Could you please provide exact steps to reproduce (including all source code necessary to run into the error) so that we can find your issue (http://sscce.org/)? Thanks! |
The same error happens on a clean React Native project with no other dependencies added except uuid. If it's caused by an old version being used in the project, it looks like React Native's xcode package uses version 3.4.0 (and Jest, but that should affect only tests.)
|
@judygab are you still experiencing this issue? |
Yes, I could not find the solution and ended up not using the module. |
When I tried it last week, it didn't work because of other problems with React Native that are tracked in other issues. But as far as I can tell this specific issue is not a problem anymore. |
Thanks for the update @juhana ! Closing since it doesn't seem to affect active users anymore. Please feel free to open a new issue if anything comes up. |
Describe the bug
I installed uuid in my react native project, following the instructions in readme and encountered problems with it.
I followed the steps of clearing caches, deleting node modules and installing.
I'm attaching the image of the error that I am getting.
Runtime
The text was updated successfully, but these errors were encountered: