I have an existing react native web expo app. And I updated some packages and updated expo. But apparently the icons are not visible anymore.
And of couse I googled a lot. And I tried a lot of different scenario’s. And Of course this question has already be posted. But I am realy stuck because I just made an simple component. And it still does not work.
So this is the simple component:
import { Button } from "react-native-paper";
import React from "react";
export const AccountScreen = ({ navigation }) => {
return (
<Button
icon="camera-outline"
mode="contained"
onPress={() => console.log("Pressed")}
>
Press me
</Button> );
};
export default AccountScreen;
And package.json looks:
{
"name": "app",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start:production": "NODE_ENV=production npx expo export:web .env.production --openssl-legacy-provider, react-app-rewired start react-scripts start",
"start:development": "NODE_ENV=development expo start --openssl-legacy-provider, react-app-rewired start react-scripts start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"lint": "eslint . --ext .js",
"postinstall": "patch-package",
"build": "react-scripts build NODE_ENV=production npm run clean && webpack -p",
"start-webpack": "webpack-dev-server --mode production --open"
},
"dependencies": {
"@ant-design/icons": "4.0.0",
"@expo-google-fonts/lato": "^0.2.2",
"@expo-google-fonts/oswald": "^0.2.2",
"@expo/config": "~9.0.0",
"@expo/metro-config": "~0.18.11",
"@expo/vector-icons": "^14.0.2",
"@expo/webpack-config": "~19.0.1",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-navigation/bottom-tabs": "^6.5.4",
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.11.0",
"@react-navigation/stack": "^6.4.0",
"babel-plugin-styled-components-react-native-web": "^0.2.2",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"css-to-react-native": "^3.2.0",
"env-cmd": "^10.1.0",
"expo": "^51.0.28",
"expo-file-system": "~17.0.1",
"expo-font": "~12.0.9",
"expo-linking": "~6.3.1",
"expo-modules-core": "~1.12.21",
"expo-screen-orientation": "~7.0.5",
"expo-status-bar": "~1.12.1",
"lottie-react-native": "6.7.0",
"next-transpile-modules": "^10.0.1",
"patch-package": "^8.0.0",
"process": "^0.11.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native": "0.74.5",
"react-native-autocomplete-dropdown": "^3.1.4",
"react-native-crypto": "^2.2.0",
"react-native-dotenv": "^3.4.9",
"react-native-gesture-handler": "~2.16.1",
"react-native-paper": "^5.1.3",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-size-matters": "^0.4.2",
"react-native-svg": "15.2.0",
"react-native-toast-message": "^2.2.0",
"react-native-toast-notifications": "^3.4.0",
"react-native-url-polyfill": "^2.0.0",
"react-native-vector-icons": "^10.1.0",
"react-native-web": "~0.19.10",
"react-native-web-lottie": "^1.4.4",
"react-router-native": "^6.24.1",
"react-toast-notifier": "^1.0.3",
"stream-browserify": "^3.0.0",
"styled-components": "^5.3.6",
"vm-browserify": "^1.1.2",
"webpack-cli": "^5.1.4",
"zod": "^3.22.4"
},
"parserOptions": {
"parser": "@babel/eslint-parser",
"requireConfigFile": false
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@expo/metro-runtime": "~3.2.3",
"@react-native-community/eslint-config": "^3.2.0",
"eslint": "^8.32.0",
"prettier": "^2.8.3",
"react-app-rewired": "^2.2.1",
"react-refresh": "^0.14.0",
"webpack": "^5.89.0"
},
"browser": {
"crypto": false,
"stream": false
},
"private": true
}
And I added webpack.config.js:
/* eslint-disable prettier/prettier */
const webpack = require("webpack");
const createExpoWebpackConfigAsync = require("@expo/webpack-config");
module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync(env, argv);
config.resolve.fallback = {
...config.resolve.fallback,
stream: require.resolve("stream-browserify"),
crypto: require.resolve("crypto-browserify"),
buffer: require.resolve("buffer"),
process: require.resolve("process/browser"),
vm: require.resolve("vm-browserify"),
};
// Plugins to define global variables and polyfills
config.plugins = (config.plugins || []).concat([
new webpack.ProvidePlugin({
process: "process/browser",
Buffer: ["buffer", "Buffer"],
}),
]);
return config;
};
But this all didn’t resolved the issue that the icon made visible again
So maybe there is some conflict about packages? But I don’t know.
Question: how to make the icon visible?