Skip to content

Does not compile with react-native-web #17

Description

@fijiwebdesign

Recreate

create-react-native-app rn-app-web --with-web-support
cd rn-app-web
yarn add react-native-indicators

App.js

import React from 'react';
import { UIActivityIndicator } from 'react-native-indicators'

add the module to webpack.config.js

   const babelLoaderConfiguration = {
  test: /\.js$/,
  // Add every directory that needs to be compiled by Babel during the build.
  include: [
    path.resolve(appDirectory, 'src'),
    path.resolve(appDirectory, 'node_modules/react-navigation'),
    path.resolve(appDirectory, 'node_modules/react-native-tab-view'),
    path.resolve(appDirectory, 'node_modules/react-native-paper'),
    path.resolve(appDirectory, 'node_modules/react-native-vector-icons'),
    path.resolve(appDirectory, 'node_modules/react-native-safe-area-view'),
    path.resolve(appDirectory, 'node_modules/@expo/samples'),
    path.resolve(appDirectory, 'node_modules/@expo/vector-icons'),
    path.resolve(appDirectory, 'node_modules/react-native-platform-touchable'),
    path.resolve(appDirectory, 'node_modules/react-native-pose'),
    path.resolve(appDirectory, 'node_modules/react-native-indicators'),

Then compile

yarn web

Error

ERROR in ./node_modules/react-native-indicators/src/components/indicator/index.js
Module not found: Error: Can't resolve 'react-native/package' in '/Users/chandra/Gabe/Jamie/hectare-app/node_modules/react-native-indicators/src/components/indicator'
 @ ./node_modules/react-native-indicators/src/components/indicator/index.js 1:1998-2029
 @ ./node_modules/react-native-indicators/index.js
 @ ./src/screens/PreLoading.js
 @ ./src/App.js
 @ ./src/index.js
 @ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server ./src/index.js

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions