我在一个反应项目,运行完美,没有错误或警告时使用纱线启动
,但当我尝试纱线构建
我得到以下错误在我的控制台:
Cannot read property 'toLowerCase' of undefined
CompileError: Begins at CSS selector .m-n1
我已经在我的代码中搜索过了,在任何组件或SCS中都没有“.m-n1”类或类似的东西。
这是我的包裹。json文件
"name": "removedForThisPost",
"version": "0.1.0",
"private": true,
"dependencies": {
"@clayui/alert": "^3.40.0",
"@clayui/card": "^3.41.0",
"@clayui/core": "^3.41.0",
"@clayui/css": "^3.41.0",
"@clayui/drop-down": "^3.41.0",
"@clayui/empty-state": "^3.40.0",
"@clayui/form": "^3.40.0",
"@clayui/icon": "^3.40.0",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"axios": "^0.24.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"sass": "^1.45.0",
"timeago.js": "^4.0.2",
"typescript": "^4.1.6",
"web-vitals": "^1.0.1"
},
"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"
]
}
}
额外信息:我正在为节点版本使用NVM,目前我在节点14.18。2(npm v6.14.15)!
如果你们需要任何其他信息,请告诉我!
好的,我发现了与你正在处理的完全相同的问题,这里有一个解决方案,用于你的npm运行构建-编译失败-无法读取未定义的属性'toLowerCase'总结一下,你有一个代码中缺少值的问题。尝试使用ctrl Shift f命令“. m-n1”在代码中搜索