question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when adding to react native web project

See original GitHub issue

I follow tutorial to add react-native-web to react-native project. but I got error when adding react-native-vector-icons to project.

./node_modules/react-native-vector-icons/lib/create-icon-set.js
SyntaxError: /home/hamidreza/Desktop/myApp/node_modules/react-native-vector-icons/lib/create-icon-set.js: Support for the experimental syntax 'classProperties' isn't currently enabled (43:22):

  41 | 
  42 |   class Icon extends PureComponent {
> 43 |     static propTypes = {
     |                      ^
  44 |       allowFontScaling: PropTypes.bool,
  45 |       name: IconNamePropType,
  46 |       size: PropTypes.number,

I also change my babel.config.js to this:

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
    [
      '@babel/plugin-proposal-class-properties',
      {
        loose: true,
      },
    ],
  ],
};

but still have the issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

0reactions
rishabhbhatiacommented, Apr 30, 2021

@Hamidrezana Hey Hamid, I added the webpack.config.js. The script in package.json runs using "web": "react-scripts start", I used the same tutorial. How can I configure it to use my custom webpack config, I’m stuck on the same error. Can you expand on your setup a bit more, would be really helpful, thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when adding react-native-web to an existing ... - GitHub
I created a react-native app, by doing react-native init ReactNativeWeb . Then, I followed the instructions here, to add react-native-web to it.
Read more >
Error when adding react native web to react native project
I just created react native project and I want to add react native web to it. I follow document provided for it but...
Read more >
Troubleshooting - React Native
If you added React Native manually to your project, make sure you have included all the relevant dependencies that you are using, ...
Read more >
Addressing common errors in React Native - LogRocket Blog
Another error that developers commonly encounter when attempting to run their React Native application is shown below: Unable to load script.
Read more >
How to add React Native Web to an existing ... - Aryan Goharzad
Initialize with Expo or use expo-cli. If you've initialized your project with Expo, it already comes with React Native for Web pre-configured.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found