expo: [expo-image] Attempted import error: 'ExpoImageModule' is not exported from './ExpoImage'.

Summary

Run on the web with expo-image package. image

What platform(s) does this occur on?

Web

SDK Version

48.0.9

Environment

expo-env-info 1.0.5 environment info: System: OS: macOS 13.0.1 Shell: 5.8.1 - /bin/zsh Binaries: Node: 14.21.3 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 6.14.18 - /usr/local/bin/npm Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: API Levels: 32, 33 Build Tools: 32.0.0, 32.1.0, 33.0.0, 33.0.0 System Images: android-25 | Google APIs ARM 64 v8a, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-30 | Google APIs ATD ARM 64 v8a, android-31 | Google APIs ARM 64 v8a, android-32 | Google Play ARM 64 v8a, android-33 | Google Play ARM 64 v8a IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 14.2/14C18 - /usr/bin/xcodebuild npmPackages: @expo/webpack-config: 0.17.4 => 0.17.4 expo: 48.0.9 => 48.0.9 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 react-native: 0.71.4 => 0.71.4 react-native-web: 0.18.12 => 0.18.12 npmGlobalPackages: eas-cli: 3.8.1 expo-cli: 6.1.0 Expo Workflow: managed

Minimal reproducible example

import { Image } from 'expo-image';

const Test = () => {
  return (
      <Image
        style={styles.logo}
        source={ImageUrl}
        resizeMode="contain"
       />
};

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

@aleqsio when will this be released?

This will be fixed once we release a new expo-image version

Yeah, I get to fix two issues at the price of one, the width, height would also make sense to be the default size of the image if no styles are set 😃

Here is the minimal repro from a fresh expo project using create-expo-app.

https://github.com/XPBytes/issue-expo-image-import

@aleqsio I’ll create a minimal repro for you. Saw this immediately after adding expo-image to an SDK 48 project.

The issue is that:

ExpoImage.tsx

…exports ExpoImageModule as a named export

And:

ExpoImage.web.tsx does not.

Sorry for missing this thread, it was published in (1.3.1) as next initially and we’ve promoted it to latest recently.

@SleeplessByte The repro shows an image once you set style={{ width: 200, height: 200 }} on the component.

At the same time, will fix the import warnings but these functions are not yet implemented on web so these functions will be a noop.

I have the same issue. Attempting to run with Web Development Server.

Does not stops app from running, but Image does not display, and terminal shows following output.

WARNING in ./node_modules/expo-image/build/Image.js:36:17
export 'ExpoImageModule' (imported as 'ExpoImageModule') was not found in './ExpoImage' (possible exports: default)
  34 |    */
  35 |   static async clearDiskCache(): Promise<boolean> {
> 36 |     return await ExpoImageModule.clearDiskCache();
     |                 ^
  37 |   }
  38 |
  39 |   render() {

My Package.json

{ "name": "app-version-2", "version": "1.0.0", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook" }, "dependencies": { "@expo/webpack-config": "^18.0.1", "@types/react": "~18.0.27", "expo": "~48.0.6", "expo-image": "~1.0.0", "expo-status-bar": "~1.4.4", "react": "18.2.0", "react-dom": "18.2.0", "react-native": "0.71.4", "react-native-web": "~0.18.10", "typescript": "^4.9.4" }, "devDependencies": { "@babel/core": "^7.20.0", "@storybook/addon-actions": "^6.5.16", "@storybook/addon-essentials": "^6.5.16", "@storybook/addon-interactions": "^6.5.16", "@storybook/addon-links": "^6.5.16", "@storybook/react": "^6.5.16", "@storybook/testing-library": "^0.0.13", "babel-loader": "^8.3.0" }, "private": true }