An Expo project created with create-expo-app
causes a bundle error when ran with expo start
command. I'm using Expo Go on iOS (both simulator and physical devise).
This happens with both a blank project and a typescript project that is created with -t expo-template-blank-typescript
flag and argument.
One of the dependencies apparently cannot find expo-constants
module.
expo-env-info 1.0.5 environment info:
System:
OS: macOS 12.2.1
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
Yarn: 1.22.18 - ~/.nvm/versions/node/v14.17.0/bin/yarn
npm: 7.22.0 - ~/.nvm/versions/node/v14.17.0/bin/npm
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
IDEs:
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
npmPackages:
expo: ~45.0.0 => 45.0.8
react: 17.0.2 => 17.0.2
react-dom: 17.0.2 => 17.0.2
react-native: 0.68.2 => 0.68.2
react-native-web: 0.17.7 => 0.17.7
npmGlobalPackages:
eas-cli: 0.56.0
expo-cli: 6.0.1
Expo Workflow: managed
iOS Bundling failed 3713ms
Unable to resolve module expo-constants from path/to/my-app/node_modules/expo-asset/build/PlatformUtils.js: expo-constants could not be found within the project or in these directories:
node_modules
1 | import computeMd5 from 'blueimp-md5';
> 2 | import Constants from 'expo-constants';
| ^
3 | import * as FileSystem from 'expo-file-system';
4 | import { NativeModulesProxy } from 'expo-modules-core';
5 | import { getManifestBaseUrl } from './AssetUris';
npx create-expo-app
"dependencies": {
"expo": "~45.0.0",
"expo-status-bar": "~1.3.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-native": "0.68.2",
"react-native-web": "0.17.7"
},
"devDependencies": {
"@babel/core": "^7.12.9"
},
I have the same problem, don't have a proper solution but this works as a workaround. Run it before expo start
.
expo install expo-constants expo-file-system expo-modules-core
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.