Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not compile with react-native-web #17

Open
fijiwebdesign opened this issue Jul 14, 2018 · 0 comments
Open

Does not compile with react-native-web #17

fijiwebdesign opened this issue Jul 14, 2018 · 0 comments

Comments

@fijiwebdesign
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant