M
M
Michael La2021-11-27 19:08:01
React
Michael La, 2021-11-27 19:08:01

Error when starting react project with vuera?

Failed to compile.

./src/components/app/App.js 16:8
Module parse failed: Unexpected token (16:8)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
 * ./node_modules/eslint-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
|
| class App extends Component {
>   state = {
|     isAuthenticated: false
|   };


.babelrc
{
    "presets": [ "@babel/react" ],
  "plugins": ["vuera/babel"]

  }


{
  "name": "lemitofrontend",
  "version": "1.0.2",
  "private": true,
  "dependencies": {
    "@bem-react/classname": "^1.5.12",
    "@loadable/component": "^5.15.0",
    "@svgr/webpack": "4.3.3",
    "@typescript-eslint/eslint-plugin": "^2.10.0",
    "@typescript-eslint/parser": "^2.10.0",
    "axios": "^0.24.0",
    "babel-eslint": "10.0.3",
    "babel-jest": "^24.9.0",
    "babel-plugin-named-asset-import": "^0.3.6",
    "babel-preset-react-app": "^9.1.1",
    "camelcase": "^5.3.1",
    "case-sensitive-paths-webpack-plugin": "2.3.0",
    "css-loader": "3.4.2",
    "dotenv": "8.2.0",
    "dotenv-expand": "5.1.0",
    "eslint": "^6.6.0",
    "eslint-config-react-app": "^5.2.0",
    "eslint-loader": "3.0.3",
    "eslint-plugin-flowtype": "4.6.0",
    "eslint-plugin-import": "2.20.0",
    "eslint-plugin-jsx-a11y": "6.2.3",
    "eslint-plugin-react": "7.18.0",
    "eslint-plugin-react-hooks": "^1.6.1",
    "file-loader": "4.3.0",
    "fs-extra": "^8.1.0",
    "html-webpack-plugin": "4.0.0-beta.11",
    "i18next": "^21.5.3",
    "i18next-browser-languagedetector": "^6.1.2",
    "i18next-http-backend": "^1.3.1",
    "i18next-locize-backend": "^4.2.3",
    "i18next-xhr-backend": "^3.2.2",
    "identity-obj-proxy": "3.0.0",
    "jest": "24.9.0",
    "jest-environment-jsdom-fourteen": "1.0.1",
    "jest-resolve": "24.9.0",
    "jest-watch-typeahead": "0.4.2",
    "json2po": "^1.0.5",
    "locize": "^2.2.4",
    "locize-lastused": "^3.0.12",
    "mini-css-extract-plugin": "0.9.0",
    "moment": "2.24.0",
    "optimize-css-assets-webpack-plugin": "5.0.3",
    "pnp-webpack-plugin": "1.6.0",
    "postcss-cli": "^9.0.2",
    "postcss-flexbugs-fixes": "4.1.0",
    "postcss-loader": "3.0.0",
    "postcss-normalize": "8.0.1",
    "postcss-preset-env": "6.7.0",
    "postcss-safe-parser": "4.0.1",
    "react": "^16.12.0",
    "react-app-polyfill": "^1.0.6",
    "react-cookie-consent": "^6.4.1",
    "react-dev-utils": "^10.2.0",
    "react-dom": "^16.12.0",
    "react-dropdown": "1.6.4",
    "react-helmet-async": "^1.1.2",
    "react-i18next": "^11.14.3",
    "react-intl": "^5.22.0",
    "react-router-dom": "5.1.2",
    "resolve": "1.15.0",
    "resolve-url-loader": "3.1.1",
    "sass-loader": "8.0.2",
    "semver": "6.3.0",
    "style-loader": "0.23.1",
    "tailwind": "^4.0.0",
    "terser": "4.6.3",
    "terser-webpack-plugin": "2.3.4",
    "ts-pnp": "1.1.5",
    "url-loader": "2.3.0",
    "vue": "^2.6.14",
    "vuera": "^0.2.7",
    "webpack": "4.41.5",
    "webpack-dev-server": "3.10.2",
    "webpack-manifest-plugin": "2.2.0",
    "workbox-webpack-plugin": "4.3.1"
  },
  "scripts": {
    "start": "node scripts/start.js",
    "build": "node scripts/build.js",
    "test": "node scripts/test.js",
    "extract:messages": "react-intl-cra './src/**/*.js' -o 'output/messages.json'",
    "extract:pot": "react-intl-po json2pot ./output/messages.json -c 'id' -o ./output/messages.po",
    "extract:po": "react-intl-po po2json input/*.po -c 'id' -m output/messages.json -o output/translation.json"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ],
  "devDependencies": {
    "@babel/core": "^7.16.0",
    "@babel/preset-env": "^7.16.4",
    "@babel/preset-react": "^7.16.0",
    "autoprefixer": "^9.8.8",
    "babel-loader": "^8.0.6",
    "chokidar-cli": "^3.0.0",
    "concurrently": "^6.3.0",
    "postcss": "^7.0.39",
    "react-intl-cra": "^0.3.4",
    "react-intl-po": "^2.2.2",
    "tailwindcss": "npm:@tailwindcss/[email protected]^2.2.17",
    "uglify-js-brunch": "^2.10.0"
  },
  "jest": {
    "roots": [
      "<rootDir>/src"
    ],
    "collectCoverageFrom": [
      "src/**/*.{js,jsx,ts,tsx}",
      "!src/**/*.d.ts"
    ],
    "setupFiles": [
      "react-app-polyfill/jsdom"
    ],
    "setupFilesAfterEnv": [],
    "testMatch": [
      "<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
      "<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
    ],
    "testEnvironment": "jest-environment-jsdom-fourteen",
    "transform": {
      "^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest",
      "^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
      "^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
    },
    "transformIgnorePatterns": [
      "[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$",
      "^.+\\.module\\.(css|sass|scss)$"
    ],
    "modulePaths": [],
    "moduleNameMapper": {
      "^react-native$": "react-native-web",
      "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
    },
    "moduleFileExtensions": [
      "web.js",
      "js",
      "web.ts",
      "ts",
      "web.tsx",
      "tsx",
      "json",
      "web.jsx",
      "jsx",
      "node"
    ],
    "watchPlugins": [
      "jest-watch-typeahead/filename",
      "jest-watch-typeahead/testname"
    ]
  }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question