question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Picker error when building with expo

See original GitHub issue

Bug report

Summary

While using the latest expo with the latest DateTimePicker, breaks the build for web. Although this component is not compatible with web, it has never been an issue for the build to succeed up until v6. It builds fine with v4 and v5. The following error occurs when doing expo start --web.

./node_modules/@react-native-community/datetimepicker/src/DateTimePickerAndroid.js:23
Module not found: Can't resolve './picker'
  21 |   validateAndroidProps,
  22 | } from './androidUtils';
> 23 | import pickers from './picker';
  24 | 
  25 | function open(props: AndroidNativeProps) {
  26 |   const {
./node_modules/@react-native-community/datetimepicker/src/androidUtils.js:6
Module not found: Can't resolve './picker'
  4 |  */
  5 | import {ANDROID_DISPLAY, ANDROID_MODE, MIN_MS} from './constants';
> 6 | import pickers from './picker';
  7 | import type {AndroidNativeProps, DateTimePickerResult} from './types';
  8 | import {sharedPropsValidation} from './utils';
  9 | import invariant from 'invariant';

Reproducible sample code

https://github.com/kjkurtz/test-expo-project Run yarn install and then

Steps to reproduce

  1. Include a DateTimePicker component within a view
  2. Run the code using expo start --web. At this point, you should see the error

Environment info

Expo 45

System:
    OS: macOS 12.3.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 89.73 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v16.14.2/bin/yarn
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: Not Found
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8512546
    Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.2 => 0.68.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

datetimepicker version: 6.1.2

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:7
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
diegonava6commented, May 25, 2022
3reactions
vonovakcommented, Jun 27, 2022

🎉 This issue has been resolved in version 6.1.4 🎉

If this package helps you, consider sponsoring us! 🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native expo image picker errors - Stack Overflow
I run "npm install expo-image-picker" instead of "expo install expo image picker" then problem has solved.
Read more >
Common development errors - Expo Documentation
This page outlines a list of errors that are commonly encountered by developers using Expo. For each error, the first bullet provides an...
Read more >
can't build expo project because of errors in expo-image-picker
I tried uninstalling and reinstalling expo-image-picker a few times. at one point updating it made there be 22 errors, and then i ran...
Read more >
react-native-community/datetimepicker - npm
React Native date & time picker component for iOS, Android and Windows. ... If you're using the expo prebuild command and building your ......
Read more >
How to use the expo-image-picker.launchCameraAsync ...
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found