![](/img/trans.png)
[英]Failed to load config "react-app" to extend from. Referenced from: C:\\package.json
[英]heroku Failed to load config "airbnb" to extend from. Referenced from: /app/.eslintrc.json
我正在嘗試將應用程序部署到 Heroku,它在我的本地運行良好。 但是在 Heroku 給我看:=>
編譯失敗
Failed to load config "airbnb" to extend from.
Referenced from: /app/.eslintrc.json
此錯誤發生在構建期間,無法消除。
我嘗試通過在 Heroku 控制台中安裝 airbn 來修復它。 但是沒有用。 如果您能幫助我,我將不勝感激。
這是我的 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"
}
}
這里是我的 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/"
]
}
我必須遵循這些步驟並修復它。
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
我遇到了同樣的問題,最后的工作是將“eslint-config-airbnb”從“devDependencies”移動到“dependencies”,如 eamanola 所示。
此外,我的上下文有點不同,因為我正在運行一個 create-react-app 和 express 應用程序。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.