oblador / react-native-vector-icons

Customizable Icons for React Native with support for image source and full styling.
https://oblador.github.io/react-native-vector-icons/
MIT License
17.31k stars 2.12k forks source link

Attempted import error: 'NativeModules' is not exported from './react-native'. #1423

Open hsavit1 opened 2 years ago

hsavit1 commented 2 years ago

Environment

Happened when trying to upgrade to react 18 and react-native-web 0.18

in my package.json

        "react": "^0.0.0-experimental-3f8990898-20220323",
        "react-dom": "^0.0.0-experimental-3f8990898-20220323",
        "react-native-web": "^0.0.0-b2a3e86d",

Description

Describe your issue in detail. Include screenshots if needed.

This was working with react 17.0.2 and react-native-web 0.17.7 . I tried upgrading to 18 and saw this compilation failure.

./node_modules/react-native-vector-icons/lib/create-icon-set.js
Attempted import error: 'NativeModules' is not exported from './react-native'.

My setup is with CRA, and I have this step in the config-overrides.js

...

module.exports = override(
...
    babelInclude([
        path.resolve(__dirname, "node_modules/react-native-vector-icons"),
    ])
...
)

Reproducible Demo

coming soon