When attempting to run Expo for web I get the error "Failed to find the instance of sharp used by the global sharp-cli package" after creating a file namedwebpack.config.js
in the root of my app folder. The contents of the file can be as simple as the default expo implementation and still fail:
module.exports = async function(env, argv) {
const loadDefaultConfigAsync = require('@expo/webpack-config');
return await loadDefaultConfigAsync(env, argv);
};
Node Version: v16.3.1
NPM Version: v8.1.2
{
"name": "foo",
"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",
"eject": "expo eject",
"test": "jest --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^12.0.0",
"@expo/webpack-config": "^0.16.11",
"@react-navigation/bottom-tabs": "^6.0.5",
"@react-navigation/native": "^6.0.2",
"@react-navigation/native-stack": "^6.1.0",
"expo": "~43.0.2",
"expo-asset": "~8.4.3",
"expo-constants": "~12.1.3",
"expo-font": "~10.0.3",
"expo-linking": "~2.4.2",
"expo-splash-screen": "~0.13.5",
"expo-status-bar": "~1.1.0",
"expo-web-browser": "~10.0.3",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.8.0",
"react-native-web": "0.17.1"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@types/react": "~17.0.21",
"@types/react-native": "~0.64.12",
"jest-expo": "~43.0.0",
"typescript": "~4.3.5"
},
"private": true
}
--save-dev
) to not include it in the app bundle:npm install --save-dev sharp-cli
– Vadose