本文介绍了模块解析失败:意外令牌 (11:19)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

web 编译失败.C:/XXX/node_modules/galio-framework/src/Toast.js 11:19模块解析失败:意外令牌 (11:19)您可能需要一个合适的加载器来处理此文件类型,目前没有配置加载器来处理此文件.请参阅 https://webpack.js.org/concepts#loaders||class Toast 扩展组件{

web Failed to compile.C:/XXX/node_modules/galio-framework/src/Toast.js 11:19Module 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 {

静态 propTypes = {|孩子: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"
}

推荐答案

正如评论中所讨论的,没有 webpack.config.js 开始.因此,通过删除 webpack 作为依赖项,解决了上述问题.

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.

要删除 webpack 并重新安装,请运行以下命令:

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

npm uninstall webpack && rm -rf node_modules && npm install

这篇关于模块解析失败:意外令牌 (11:19)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 18:19