简体   繁体   English

heroku 无法加载要扩展的配置“airbnb”。 引用自:/app/.eslintrc.json

[英]heroku Failed to load config "airbnb" to extend from. Referenced from: /app/.eslintrc.json

I'm trying to deploy an app to Heroku, it's working perfectly in my local.我正在尝试将应用程序部署到 Heroku,它在我的本地运行良好。 But in Heroku show me: =>但是在 Heroku 给我看:=>

Failed to compile编译失败

 Failed to load config "airbnb" to extend from.
 Referenced from: /app/.eslintrc.json

This error occurred during the build time and cannot be dismissed.此错误发生在构建期间,无法消除。

I try to fix it by installing airbn in the Heroku console.我尝试通过在 Heroku 控制台中安装 airbn 来修复它。 But didn't work.但是没有用。 I appreciate if you could help me.如果您能帮助我,我将不胜感激。

Here is my package.json file =>这是我的 package.json 文件 =>

{
  "name": "calculator",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.12.0",
    "@testing-library/react": "^11.2.6",
    "@testing-library/user-event": "^12.8.3",
    "big.js": "^6.1.1",
    "prop-types": "^15.7.2",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "web-vitals": "^1.1.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@babel/core": "^7.14.0",
    "@babel/eslint-parser": "^7.13.14",
    "@babel/plugin-syntax-jsx": "^7.12.13",
    "@babel/preset-react": "^7.13.13",
    "eslint": "^7.25.0",
    "eslint-config-airbnb": "^18.2.1",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-react": "^7.23.2",
    "eslint-plugin-react-hooks": "^4.2.0",
    "stylelint": "^13.13.1",
    "stylelint-config-standard": "^21.0.0",
    "stylelint-csstree-validator": "^1.9.0",
    "stylelint-scss": "^3.19.0"
  }
}

and here my eslint configuration =>这里是我的 eslint 配置 =>

{
  "env": {
    "browser": true,
    "es6": true,
    "jest": true
  },
  "parser": "@babel/eslint-parser",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": 2018,
    "sourceType": "module"
  },
  "extends": ["airbnb", "plugin:react/recommended"],
  "plugins": ["react"],
  "rules": {
    "react/jsx-filename-extension": ["warn", { "extensions": [".js", ".jsx"] }],
    "react/react-in-jsx-scope": "off",
    "import/no-unresolved": "off",
    "no-shadow": "off"
  },
  "ignorePatterns": [
    "dist/",
    "build/"
  ]
}

I had to follow these steps and that fixed it.我必须遵循这些步骤并修复它。

1| heroku create $APP_NAME --buildpack mars/create-react-app
2| git push heroku HEAD:master


Replace $APP_NAME with the name of your unique app.

here is the documentation link:

github.com/mars/create-react-app-buildpack

I was experiencing the same issues and finally what worked was to move "eslint-config-airbnb" from "devDependencies" to "dependencies" as indicated by eamanola.我遇到了同样的问题,最后的工作是将“eslint-config-airbnb”从“devDependencies”移动到“dependencies”,如 eamanola 所示。

Also, my context was a bit different, as I was running a create-react-app and express app.此外,我的上下文有点不同,因为我正在运行一个 create-react-app 和 express 应用程序。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载要扩展的配置“react-app”。 引用自:C:\\package.json - Failed to load config "react-app" to extend from. Referenced from: C:\\package.json Netlify/Craco 无法加载要扩展的配置“react-app”。 引用自:/opt/build/repo/package.json - Netlify/Craco Failed to load config "react-app" to extend from. Referenced from: /opt/build/repo/package.json 创建 React 应用程序 - (ESLint) 无法加载要扩展的配置“shared-config”。 引用自:<PATH> 在 Visual Studio 中 - Create React App - (ESLint) Failed to load config "shared-config" to extend from. Referenced from: <PATH> in Visual Studio 无法加载要扩展的配置“@ljharb”。 (ESLint 8,网页包 5) - Failed to load config "@ljharb" to extend from. (ESLint 8, Webpack 5) eslint 无法加载要扩展的配置“react-app”。 在项目中进行更改时 - eslint Failed to load config "react-app" to extend from. when making changes in project Eslint 插件“反应”在 eslintrc.json >> eslint-config-airbnb 之间发生冲突 - Eslint Plugin "react"was conflicted between .eslintrc.json >> eslint-config-airbnb 语法错误:错误:无法加载要扩展的配置“ckeditor5”。 将 CKEditor 导入 Vuejs 时 - Syntax Error: Error: Failed to load config “ckeditor5” to extend from. While importing CKEditor to Vuejs 如何解决无法加载配置“更漂亮”以进行扩展。 在反应 Js - How to Resolve Failed to load config “prettier” to extend from. in react Js React 应用程序在部署到 heroku 时无法加载配置“airbnb” - React app failed to load config "airbnb" in deploying to heroku 无法加载在“.eslintrc.json”中声明的插件“prettier”:找不到模块“eslint-plugin-prettier” - Failed to load plugin 'prettier' declared in '.eslintrc.json': Cannot find module 'eslint-plugin-prettier'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM