6

web Failed to compile. C:/XXX/node_modules/galio-framework/src/Toast.js 11:19 Module parse failed: Unexpected token (11:19) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | | class Toast extends Component {

static propTypes = { | children: PropTypes.node.isRequired, | isShow: PropTypes.bool.isRequired,

{
  "name": "Bay",
  "version": "1.3.0",
  "description": "Desc",
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "postinstall": "jetify"
  },
  "repository": {
    "type": "git",
    "url": "git+https://gx.git"
  },
  "dependencies": {
    "expo": "^35.0.0",
    "expo-asset": "~7.0.0",
    "expo-font": "~7.0.0",
    "galio-framework": "^0.6.3",
    "prop-types": "^15.7.2",
    "react": "16.8.3",
    "react-dom": "16.8.3",
    "react-native": "0.59.10",
    "react-native-gesture-handler": "~1.3.0",
    "react-native-modal-dropdown": "^0.6.2",
    "react-native-reanimated": "~1.3.0",
    "react-native-screens": "1.0.0-alpha.23",
    "react-native-unimodules": "0.6.0",
    "react-native-web": "^0.11.7",
    "react-navigation": "^3.11.0",
    "webpack": "^4.41.6"
  },
  "devDependencies": {
    "@babel/core": "^7.6.0",
    "babel-jest": "24.9.0",
    "jest": "24.9.0",
    "jetifier": "^1.6.4",
    "metro-react-native-babel-preset": "0.56.0",
    "react-test-renderer": "16.9.0",
    "babel-preset-expo": "^7.0.0"
  },
  "keywords": [
    "argon react native",
    "argon design system",
    "argon app react native",
    "argon iOS",
    "react native iOS",
    "creative tim",
    "argon Android",
    "react native ui kit",
    "react native expo",
    "freebie",
    "react native argon design",
    "react native galio",
    "galio argon free",
    "galio react native free app",
    "argon expo react native",
    "react native ui template"
  ],
  "author": "ss",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/creativetimofficial/argon-react-native/issues"
  },
  "homepage": "https://demos.creative-tim.com/argon-react-native"
}
Sufail Kalathil
  • 558
  • 6
  • 21
  • can you share your `webpack.config.js` ? – kenmistry Feb 12 '20 at 12:18
  • @kenmistry i'm new to react native.there is no file on project location with name webpack.config.js .am i missed any npm plugins for webpack ? – Sufail Kalathil Feb 12 '20 at 12:25
  • if the `webpack.config.js` file is not there, it is strange that you are facing this issue since installing `webpack` should initially set up the file for you. and it can be the command you have executed containing the `webpack`. perhaps, removing any `webpack` command should resolve the issue. – kenmistry Feb 12 '20 at 12:45
  • @kenmistry what kind of `webpack` command remove from the project directory to resolve the issue – Sufail Kalathil Feb 12 '20 at 12:49
  • what command did you run that is causing this issue? for example, if it is `npm start`, go to `package.json` and look under `scripts`. remove any `webpack` words you see under `start: ...`. if it doesn't work, can you share your `package.json` above? i'll take a look. – kenmistry Feb 12 '20 at 12:51
  • @kenmistry take a look at `package.json` – Sufail Kalathil Feb 12 '20 at 13:03
  • can you do an uninstall of `webpack` and try running the previous command? how did `webpack` get listed as a dependency if there are no `webpack` commands under `scripts` and no `webpack.config.js` file present? – kenmistry Feb 12 '20 at 13:07
  • @kenmistry no `webpack` commands under `scripts` and no `webpack.config.js`.updated question along with `package.json` . take a look at the same – Sufail Kalathil Feb 12 '20 at 13:30
  • `webpack` is still listed as a dependency. can you uninstall it and remove all `node modules` before doing a reinstallation? thanks. – kenmistry Feb 12 '20 at 13:34
  • can you give `npm` command to uninstall `webpack`. `npm uninstall` for removing all node modules right ? – Sufail Kalathil Feb 12 '20 at 13:49
  • firstly, `npm uninstall webpack` . secondly, `rm -rf node_modules && npm install` . – kenmistry Feb 12 '20 at 13:54
  • @kenmistry now getting new error regarding `expo`.Expo sdk requires to run – Sufail Kalathil Feb 12 '20 at 14:03
  • you should set up a new question for this, since it is no longer relevant to the initial question. as for the initial question, i have added my above comments as an answer so you can accept it and close this question. – kenmistry Feb 13 '20 at 04:32
  • 1
    expo sdk error resolved by installing expo clii by the command `npm install -g expo-cli`.expo server should be start to run the application – Sufail Kalathil Feb 13 '20 at 05:12

2 Answers2

12

If you are using Expo, I added the following to my app.json:

"web": {
  "build": {
    "babel": {
      "include": ["galio-framework"]
    }
  }
}
ShadowMinhja
  • 293
  • 2
  • 10
1

as discussed in the comments, there is no webpack.config.js to begin with. so, by removing webpack as a dependency, the above issue is resolved.

to remove webpack and perform a re-install, run the following command:

npm uninstall webpack && rm -rf node_modules && npm install
kenmistry
  • 1,934
  • 1
  • 15
  • 24