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

Something is not working with react-native-elements #1237

Closed
ChuchoPV opened this issue Jan 31, 2019 · 8 comments
Closed

Something is not working with react-native-elements #1237

ChuchoPV opened this issue Jan 31, 2019 · 8 comments

Comments

@ChuchoPV
Copy link

I don't know if the problem is in react-native-web or react-native-elements or even me.

But I install react native and also react native elements and everything is fine until I tried to use the Button element importing it like this:

import { Button } from 'react-native-elements';

but the problem that I have is the following:

screen shot 2019-01-31 at 5 52 19 pm

I have another project working with react-native and react-native-elements but not react-native-web and works fine. If anyone could help it would be perfect.

I give my package.json:

{
  "name": "cuestionario",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material-ui/core": "^3.9.1",
    "react": "^16.7.0",
    "react-art": "^16.7.0",
    "react-bootstrap": "^0.32.4",
    "react-device-detect": "^1.6.2",
    "react-dom": "^16.7.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz",
    "react-native-vector-icons": "^6.2.0",
    "react-native-web": "^0.10.0",
    "react-scripts": "2.1.3",
    "react-native-elements": "^1.0.0-beta2",
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}

@0xpatrickdev
Copy link

@ChuchoPV have you set up webpack and babel as described in the Getting Started guide?

In order to have react-native modules play nicely, you need to instruct babel to compile them.

Two more things to note:

@devals9
Copy link

devals9 commented Feb 5, 2019

I just upgraded react native elements to v1.0.0 and I have started getting a very similar error. Did you find a solution it ?
"export 'default' (imported as 'normalize') was not found in '../helpers/normalizeText'

@kilbot
Copy link

kilbot commented Feb 7, 2019

@ChuchoPV and @devals9, this is an error introduced in react-native-elements v1.0.0, it will be fixed in the next version.

You can update to the next branch, ie:

npm install git://github.com/react-native-training/react-native-elements#next

or you can find the normalizeText.js file in your node_modules directory and update it directly. I'm not too sure when the fix will be released but it shouldn't be too long.

@ChuchoPV
Copy link
Author

ChuchoPV commented Feb 7, 2019

I tried to install Babel and other dependencies but it doesn't still working.
I really do not find a specific solution, but I just render the old components inside the
and it works perfectly.
Because if you tried to downgrade the version of react-elements happens the same thing.
So this is what I do, but I have no found a specific solution.
Even though, I believe this post should also be in react-native-elements GitHub

@devals9
Copy link

devals9 commented Feb 8, 2019

I tried to install the next branch it removed, that solved my normalize error but started giving some other errors about @babel/plugin-proposal-class-properties. I did that too but it didn't really help.

@kilbot
Copy link

kilbot commented Feb 9, 2019

Hi @devals9, check which modules are causing the error. React Native Elements v1.0.0 now requires some extra packages and you may have to include these in your webpack config, eg:

path.resolve('node_modules/react-native-elements'),
path.resolve('node_modules/react-native-ratings'),
path.resolve('node_modules/react-native-status-bar-height'),
path.resolve('node_modules/react-native-vector-icons'),

In any case, @ChuchoPV is correct, this is a react-native-elements problem so you should check the issues over there.

@yujie-tao
Copy link

Same situation. It's a problem of react-native-element

@necolas
Copy link
Owner

necolas commented Mar 12, 2019

It does appear to be a problem related to bundling react-native-elements on web. Hopefully they will have a fix

@necolas necolas closed this as completed Mar 12, 2019
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

6 participants