New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Plugin 3 specified in "base" provided an invalid property of "Affix" #186
Labels
Comments
删除 node_modules 重新安装试试? 不行把 |
谢谢,不好意思新手,项目是直接使用 user-dashboard 上修改的。 node_modules 被删除过很多次(墙里墙外都试过)。以为是nodejs版本问题(4.6 与 6.9 已经尝试过了)。 现在把package.json 里面所有相关的包都更新到了最新版本,删除node_modules 重新安装 {
"private": true,
"entry": {
"index": "./src/index.js"
},
"dependencies": {
"antd": "^2.1.0",
"classnames": "^2.2.5",
"dva": "^1.1.0",
"qs": "^6.3.0",
"react": "^15.3.2",
"react-dnd": "^2.1.4",
"react-dnd-html5-backend": "^2.1.2",
"react-dom": "^15.3.2",
"react-router": "^2.8.1"
},
"devDependencies": {
"atool-build": "^0.9.0",
"babel-eslint": "^7.0.0",
"babel-plugin-import": "^1.0.1",
"babel-plugin-dva-hmr": "^0.2.0",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-runtime": "^6.11.6",
"dora": "0.4.3",
"dora-plugin-proxy": "^0.8.5",
"dora-plugin-webpack": "^0.8.1",
"dora-plugin-webpack-hmr": "^0.2.1",
"eslint": "^3.8.1",
"eslint-config-airbnb": "^12.0.0",
"eslint-plugin-import": "^1.16.0",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.4.1 ",
"redbox-react": "^1.3.2"
},
"scripts": {
"start": "dora --plugins \"proxy,webpack,webpack-hmr\"",
"lint": "eslint --fix --ext .js,.jsx .",
"build": "atool-build"
}
} 执行npm start可以正常building 但是刷新页面没有ant的样式。 Module build failed: Error: Plugin 3 specified in "base" provided an invalid property of "Affix" webpack.config 文件 const fs = require('fs');
const path = require('path');
module.exports = function (webpackConfig, env) {
webpackConfig.babel.babelrc = false;
webpackConfig.babel.plugins.push('transform-runtime');
webpackConfig.babel.plugins.push(['antd', {
style: 'css' // if true, use less
}]);
// Enable hmr for development.
if (env === 'development') {
webpackConfig.babel.plugins.push(['dva-hmr', {
entries: [
'./src/index.js',
]
}]);
}
//webpackConfig.devtool = 'source-map';
// Parse all less files as css module.
webpackConfig.module.loaders.forEach(function (loader, index) {
if (typeof loader.test === 'function' && loader.test.toString().indexOf('\\.less$') > -1) {
loader.test = /\.dont\.exist\.file/;
}
if (loader.test.toString() === '/\\.module\\.less$/') {
loader.test = /\.less$/;
}
});
return webpackConfig;
}; |
webpack.config.js 里把 webpackConfig.babel.plugins.push(['import', {
libraryName: 'antd',
style: 'css' // if true, use less
}]); |
问题解决了,非常感谢。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这个诡异问题一直无法确定。到底是什么问题导致的。不清楚是dvajs 的问题还是 ant-design(版本2.0)
不同的电脑相同的包配置,清除全局安装的,我的电脑可以正常编译,同事的电脑就会出现此问题。
package.json 文件依赖
The text was updated successfully, but these errors were encountered: