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

hey, i face a small problem, Unable to resolve module @src #30440

Open
Jimmylxue opened this issue Jul 17, 2024 · 0 comments
Open

hey, i face a small problem, Unable to resolve module @src #30440

Jimmylxue opened this issue Jul 17, 2024 · 0 comments
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@Jimmylxue
Copy link

Minimal reproducible example

https://github.com/Jimmylxue/JVlog

What platform(s) does this occur on?

Android

Where did you reproduce the issue?

in Expo Go

Summary

my tsconfig.json:

{
  "extends": "expo/tsconfig.base",
  "compilerOptions": {
    "strict": true,
    "baseUrl": ".",
    "paths": {
      "@src/*": ["src/*"],
      "@assets/*": ["./src/assets/*"],
      "@hooks/*": ["./src/hooks/*"],
      "@navigation/*": ["src/navigation/*"],
      "@screens/*": ["./src/screens/*"],
      "@styles/*": ["./src/styles/*"],
      "@utils/*": ["./src/utils/*"],
      "@store/*": ["./src/store/*"],
      "@components/*": ["./src/components/*"]
    }
  },
  "include": [
    "**/*.ts",
    "**/*.tsx",
    ".expo/types/**/*.ts",
    "expo-env.d.ts"
  ]
}

my app.json

{
  "expo": {
    "name": "my-app",
    "slug": "my-app",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "permissions": [
        "android.permission.CAMERA",
        "android.permission.RECORD_AUDIO",
        "android.permission.READ_EXTERNAL_STORAGE",
        "android.permission.WRITE_EXTERNAL_STORAGE",
        "android.permission.ACCESS_MEDIA_LOCATION"
      ],
      "package": "com.jimmyhaodev.myapp"
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "plugins": [
      [
        "expo-camera",
        {
          "cameraPermission": "Allow JVlog to access your camera",
          "microphonePermission": "Allow JVlog to access your microphone",
          "recordAudioAndroid": true
        }
      ],
      [
        "expo-media-library",
        {
          "photosPermission": "Allow JVlog to access your photos.",
          "savePhotosPermission": "Allow JVlog to save photos.",
          "isAccessMediaLocationEnabled": true
        }
      ]
    ],
    "extra": {
      "eas": {
        "projectId": "xxxxxx"
      }
    }
  }
}

my eas.json

{
  "cli": {
    "version": ">= 10.0.2"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal"
    },
    "production": {
      "android": {
      "buildType": "apk"
    },
    "ios": {
      "resourceClass": "m1-medium"
    }
    },
    "release": {
            "android": {
                "buildType": "apk"
            }
        }
  },
  "submit": {
    "production": {}
  }
}

i build android fail when i build by local, command is NODE_ENV=production eas build --profile release --platform android --local

error is can't resolve module @src/xxx/xxx
image-20240717103200003

development environment can success resolve this module, but in build release environment has this error.

Thank you very much for taking a look at this

Environment

expo-env-info 1.2.0 environment info:
System:
OS: macOS 14.3
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.14.0 - ~/.nvm/versions/node/v20.14.0/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v20.14.0/bin/yarn
npm: 10.7.0 - ~/.nvm/versions/node/v20.14.0/bin/npm
Managers:
CocoaPods: 1.15.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.5, iOS 17.5, macOS 14.5, tvOS 17.5, visionOS 1.2, watchOS 10.5
IDEs:
Android Studio: 2023.3 AI-233.14808.21.2331.11709847
Xcode: 15.4/15F31d - /usr/bin/xcodebuild
npmPackages:
expo: ~51.0.20 => 51.0.20
react: 18.2.0 => 18.2.0
react-native: 0.74.3 => 0.74.3
npmGlobalPackages:
eas-cli: 10.0.2
Expo Workflow: managed

Expo Doctor Diagnostics

✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check native tooling versions
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check for issues with metro config
✔ Check npm/ yarn versions
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check Expo config (app.json/ app.config.js) schema
✖ Check that packages match versions required by installed Expo SDK
✔ Check that native modules use compatible support package versions for installed Expo SDK

Detailed check results:

The following packages should be updated for best compatibility with the installed expo version:
[email protected] - expected version: ~51.0.21
[email protected] - expected version: ~15.0.14
[email protected] - expected version: ~12.0.9
[email protected] - expected version: ~5.3.3
Your project may not work correctly until you install the expected versions of the packages.
Found outdated dependencies
Advice: Use 'npx expo install --check' to review and upgrade your dependencies.

@Jimmylxue Jimmylxue added the needs validation Issue needs to be validated label Jul 17, 2024
@expo-bot expo-bot added needs review Issue is ready to be reviewed by a maintainer and removed needs validation Issue needs to be validated labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants