- Я пытаюсь вызвать свое приложение.
- У меня есть два package.json, один для сервера, а другой для клиента.
- Когда я запускаю сборку npm, сборка выполняетсяуспешно, как в клиентской, так и в корневой папке
- , когда я запускаю npm и запускаю dev, приложение не запускается.
- , поэтому я отладил и обнаружил ошибки в консоли -и его указание на этот файл реагирует - dom.production.min.js: 198 и css - vendor.esm.js: 67
- Я думаю, что проблема связана с этим packages.jss - preset -по умолчанию и реагируйте - jss
- подскажите, как это исправить, предоставив мой package.json и ошибки ниже
client package.json
{
"name": "players",
"version": "0.1.0",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.14",
"@fortawesome/free-solid-svg-icons": "^5.7.1",
"@fortawesome/react-fontawesome": "^0.1.4",
"@material-ui/core": "^3.9.2",
"autosuggest-highlight": "^3.1.1",
"axios": "^0.18.0",
"fa5-pro-light": "^5.6.1",
"fa5-pro-regular": "^5.6.1",
"fa5-pro-solids": "^5.6.1",
"gos-theme": "^3.1.0",
"jss-preset-default": "^10.0.0-alpha.7",
"leaflet": "^1.3.3",
"leaflet.markercluster": "^1.3.0",
"lodash": "^4.17.10",
"material-ui-chip-input": "^1.0.0-beta.7",
"react": "^16.4.1",
"react-autosuggest": "^9.3.4",
"react-csv": "^1.0.14",
"react-dom": "^16.4.1",
"react-helmet": "^5.2.0",
"react-icons-kit": "^1.1.5",
"react-jss": "^8.6.1",
"react-leaflet": "^2.0.1",
"react-leaflet-markercluster": "^2.0.0-rc3",
"react-redux": "^5.0.7",
"react-redux-loading-bar": "^4.2.0",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.4",
"react-select": "^2.0.0",
"react-to-print": "^2.0.0-alpha-6",
"redux": "^4.0.0",
"redux-form": "^7.4.2",
"redux-promise": "^0.6.0",
"redux-thunk": "^2.3.0",
"styled-components": "^3.4.9"
},
"scripts":
{
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"setup": "npm install fa5-pro-light fa5-pro-solids fa5-pro-regular gos-theme --registry http://artifactory.bcbsfl.com/artifactory/api/npm/npm-libs-virtual"
}
,
"devDependencies": {
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"moxios": "^0.4.0"
}
}
корневая папка package.json
{
"name": "sports",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js",
"server": "nodemon index.js",
"client": "cd .. && npm run start",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"build": "cd client && npm install && npm run build && cd ..",
"qb": "cd client && npm run build && cd .."
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.18.0",
"body-parser": "^1.18.3",
"compression": "^1.7.3",
"config": "^2.0.1",
"cors": "^2.8.4",
"dotenv": "^6.2.0",
"exceljs": "^1.6.2",
"express": "^4.16.4",
"joi": "^14.0.3",
"jsonwebtoken": "^8.3.0"
},
"devDependencies": {
"concurrently": "^4.0.1",
"nodemon": "^1.18.5"
},
"jest": {
"roots": [
"server"
]
},
"standard": {
"ignore": [
"**/node_modules/",
"**/coverage/"
]
}
}
ошибки
react - dom.production.min.js: 198 TypeError: Cannot read property '1' of undefined
at r(css - vendor.esm.js: 67)
at Array.e(jss - plugin - vendor - prefixer.esm.js: 14)
at e.value(PluginsRegistry.js: 56)
at Array.forEach(<anonymous>)
at e.value (RuleList.js:163)
at new e (StyleSheet.js:55)
at e.value (Jss.js:123)
at t.value (withStyles.js:286)
at t.value (withStyles.js:256)
at new t (withStyles.js:138)
react-dom.production.min.js:198
var ph = "function" === typeof WeakSet ? WeakSet : Set;
function qh(a, b) {
var c = b.source
, d = b.stack;
null === d && null !== c && (d = jc(c));
null !== c && ic(c.type);
b = b.value;
null !== a && 1 === a.tag && ic(a.type);
try {
// pointing here console.error(b) // pointing here
} catch (e) {
setTimeout(function () {
throw e;
})
}
}
Uncaught TypeError: Cannot read property '1' of undefined
at r (css-vendor.esm.js:67)
at Array.e (jss-plugin-vendor-prefixer.esm.js:14)
at e.value (PluginsRegistry.js:56)
at Array.forEach (<anonymous>)
at e.value (RuleList.js:163)
at new e (StyleSheet.js:55)
at e.value (Jss.js:123)
at t.value (withStyles.js:286)
at t.value (withStyles.js:256)
at new t (withStyles.js:138)
function supportedKeyframes(key) {
// Keyframes is already prefixed. e.g. key = '@-webkit-keyframes a'
// pointing here if (key[1] === '-') return key; // No need to prefix IE/Edge. Older browsers will ignore unsupported rules.
// https://caniuse.com/#search=keyframes
if (prefix.js === 'ms') return key;
return "@" + prefix.css + "keyframes" + key.substr(10);
}