Skip to content
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

Problem with setting up the project image picker issue #5761

Open
X1Vi opened this issue Jun 26, 2024 · 6 comments
Open

Problem with setting up the project image picker issue #5761

X1Vi opened this issue Jun 26, 2024 · 6 comments

Comments

@X1Vi
Copy link

X1Vi commented Jun 26, 2024

I just ran these two command

yarn install yarn android

and this error occurred something related to the image picker
`needJobCoder@DESKTOP-G3MCU14 MINGW64 /c/openSource/rocker-react-native/Rocket.Chat.ReactNative/Rocket.Chat.ReactNative (develop)
$ yarn react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
yarn run v1.22.21
$ C:\openSource\rocker-react-native\Rocket.Chat.ReactNative\Rocket.Chat.ReactNative\node_modules.bin\react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
warn Package react-native-math-view contains invalid configuration: "dependency.assets" is not allowed. Please verify it's properly linked using "npx react-native config" command and contact the package maintainers about this.
Welcome to Metro v0.80.6
Fast - Scalable - Integrated

error Unable to resolve module @react-native-community/picker from C:\openSource\rocker-react-native\Rocket.Chat.ReactNative\Rocket.Chat.ReactNative\node_modules\react-native-ui-lib\lib\components\WheelPicker\index.js: @react-native-community/picker could not be found within the project or in these directories:
node_modules\react-native-ui-lib\node_modules
node_modules
3 | import React, {Component} from 'react';
4 | import {DeviceEventEmitter, requireNativeComponent, StyleSheet, View} from 'react-native';

5 | import {Picker} from '@react-native-community/picker';
| ^
6 | import WheelPickerItem from './WheelPickerItem';
7 | import {Constants} from '../../../src/helpers';
8 | import {Typography, Colors} from '../../../src/style';.
Error: Unable to resolve module @react-native-community/picker from C:\openSource\rocker-react-native\Rocket.Chat.ReactNative\Rocket.Chat.ReactNative\node_modules\react-native-ui-lib\lib\components\WheelPicker\index.js: @react-native-community/picker could not be found within the project or in these directories:
node_modules\react-native-ui-lib\node_modules
node_modules
3 | import React, {Component} from 'react';
4 | import {DeviceEventEmitter, requireNativeComponent, StyleSheet, View} from 'react-native';
5 | import {Picker} from '@react-native-community/picker';
| ^
6 | import WheelPickerItem from './WheelPickerItem';
7 | import {Constants} from '../../../src/helpers';
8 | import {Typography, Colors} from '../../../src/style';
at ModuleResolver.resolveDependency (C:\openSource\rocker-react-native\Rocket.Chat.ReactNative\Rocket.Chat.ReactNative\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:138:15)
at DependencyGraph.resolveDependency (C:\openSource\rocker-react-native\Rocket.Chat.ReactNative\Rocket.Chat.ReactNative\node_modules\metro\src\node-haste\DependencyGraph.js:231:43)
at C:\openSource\rocker-react-native\Rocket.Chat.ReactNative\Rocket.Chat.ReactNative\node_modules\metro\src\lib\transformHelpers.js:156:21
at resolveDependencies (C:\openSource\rocker-react-native\Rocket.Chat.ReactNative\Rocket.Chat.ReactNative\node_modules\metro\src\DeltaBundler\buildSubgraph.js:42:25)
at visit (C:\openSource\rocker-react-native\Rocket.Chat.ReactNative\Rocket.Chat.ReactNative\node_modules\metro\src\DeltaBundler\buildSubgraph.js:83:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 2)
at async visit (C:\openSource\rocker-react-native\Rocket.Chat.ReactNative\Rocket.Chat.ReactNative\node_modules\metro\src\DeltaBundler\buildSubgraph.js:92:5)
at async Promise.all (index 3)
at async visit (C:\openSource\rocker-react-native\Rocket.Chat.ReactNative\Rocket.Chat.ReactNative\node_modules\metro\src\DeltaBundler\buildSubgraph.js:92:5)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
`

@diegolmello
Copy link
Member

Maybe patch-package was not applied correctly?

+import {Picker} from '@react-native-picker/picker';

It's triggered on postinstall, but it seems it wasn't triggered correctly on your environment.
Try to understand why it wasn't applied or apply everything from patches folder manually.

@X1Vi
Copy link
Author

X1Vi commented Jun 26, 2024

Maybe patch-package was not applied correctly?

+import {Picker} from '@react-native-picker/picker';

It's triggered on postinstall, but it seems it wasn't triggered correctly on your environment.
Try to understand why it wasn't applied or apply everything from patches folder manually.

Post install and what file in specific in patch ?

@X1Vi
Copy link
Author

X1Vi commented Jun 26, 2024

https://paste.myst.rs/skuw5ded here is 7.2.1 file

@X1Vi
Copy link
Author

X1Vi commented Jun 26, 2024

I think there was a change in the library name or something

@Lao-Ax
Copy link
Contributor

Lao-Ax commented Sep 25, 2024

Actually I faced with similar problem. I use yarn 4+ and a lot of patches just not applied. Even dericlty by git.
There is a lot differences in resulting node-modules files. Like " or ', spaces. Some times lines of code differ completely.

I didin't realise that something like this could even happen.

An example: master (v4.51)
patch for node_modules/react-native-ui-lib/src/components/connectionStatusBar/index

  1. my node-modules doesn't have ts file. Only js.
  2. in the pathc there is a line import {ConnectionStatusBarProps, ConnectionStatusBarState, DEFAULT_PROPS} from './Types'; Note: there are 3 modules. But in the node-modules I have import { ConnectionStatusBarProps, DEFAULT_PROPS } from "./Types"; - just 2.

I'm a bit confused :)
If someone faced the same and got a solution - I'll be appreciate.

@Lao-Ax
Copy link
Contributor

Lao-Ax commented Sep 27, 2024

For those who will be after me.

Error Package react-native-math-view contains invalid configuration: "dependency.assets" was solved by this post wix/react-native-navigation#7647

It means you have to write a patch to delete assets from the react-native-math-view lib.

Regarding differences yarn4 and yarn1. I noticed that yarn 1 downloads code via codeload using tar.gz, when yarn4 uses just hash commit. I solved this issue by adding to the package.json to the resolutions section a copy of a line from yarn1 lock file for a moot lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants