akveo / react-native-ui-kitten

:boom: React Native UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/react-native-ui-kitten/
MIT License
10.36k stars 958 forks source link

Turning on metro config for custom mapping breaking console logging #1763

Open Villar74 opened 1 year ago

Villar74 commented 1 year ago

🐛 Bug Report

After activating MetroConfig.create in metro.config.js for custom mapping, logger breaks and nothing logged to console, may be other features of metro disabling as well. That happens when I'm trying to mix evaDesign config with svg setup for react-native svg.

image

Also default setup for Metro-config by ui-kitten throws warnings in console:

image

To Reproduce

  1. Add ui-kitten and react-native svg babel transformer
  2. edit metro.config.js to look like:
    
    const { getDefaultConfig } = require('metro-config');

const MetroConfig = require('@ui-kitten/metro-config');

const evaConfig = { evaPackage: '@eva-design/eva', // Optional, but may be useful when using mapping customization feature. customMappingPath: './src/consts/mapping.json', }; module.exports = (async () => { const { resolver: { sourceExts, assetExts }, } = await getDefaultConfig(__dirname);

const config = { transformer: { babelTransformerPath: require.resolve('react-native-svg-transformer'), getTransformOptions: async () => ({ transform: { experimentalImportSupport: false, inlineRequires: true, }, }), }, resolver: { assetExts: assetExts.filter((ext) => ext !== 'svg'), sourceExts: [...sourceExts, 'svg'], }, }; return MetroConfig.create(evaConfig, config); })();


## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->
Expected to metro working same as before implementing ui-kitten

## UI Kitten and Eva version

| Package      | Version |
| ----------- | ----------- |
| @eva-design/eva      |    2.2.0    |
| @ui-kitten/components   |     5.3.1    |

## Environment information

<!--
Run npx envinfo --preset react-native
Paste the results here:
-->

```bash
System:
    OS: macOS 13.4
    CPU: (12) arm64 Apple M2 Pro
  Binaries:
    Node: 20.0.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.6.4 - /opt/homebrew/bin/npm
    Watchman: 2023.05.01.00 - /opt/homebrew/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    Android SDK:
      API Levels: 31, 33
      Build Tools: 30.0.2, 30.0.3, 31.0.0, 33.0.0, 33.0.2
      System Images: android-33 | Google APIs ARM 64 v8a
  IDEs:
    Android Studio: Flamingo 2022.2.1 Patch 1 Flamingo 2022.2.1 Patch 1
    Xcode: 14.3/14E222b - /usr/bin/xcodebuild
  npmPackages:
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.8 => 0.71.8 
Datmon commented 1 year ago

Have the same problem

kamalmplus commented 1 year ago

same problem