[英]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.