-
Notifications
You must be signed in to change notification settings - Fork 301
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
我在用web-dev-server时遇到下列问题 #109
Comments
我是用了import Table from 'rctui/Table' |
删了node_modules,然后npm i试试~ npm里面本地库版本换来换去,很容易出毛病,删了重建最干净~ |
webpack配置了babel-loader么。新项目的话,可以试试这个脚手架,https://github.com/Lobos/ogier-react |
我配置了babel-loader const extractCSS = new ExtractTextPlugin('[name].fonts.css');
} |
.babelrc中 |
package.json中 |
你的babel-loader配置了exclude,把 rctui 给排除了,去掉这个,使用 include 来配置
|
include 应该如何配置,我将node_modules/rctui加入include中,还有很多错误 |
可以先不配置 include 和 exclude,看一下有没有问题 |
Copilded successfully。但运行报错 |
浏览器里执行出错?这个是没有引入React 库吧,在html里面引入就好了吧。 |
为什么没有加入rctui之前,是可以运行的 |
因为测试项目中需要TABLE,我就装了rctui,之后就不能正常了 |
一般 npm install rctui 之后,就可以直接import 使用了,不是太明白这个rctui还要做哪些事 |
呃,这个是babel的问题……它的某些版本,需要强制require React,可以用这个插件 npm install babel-plugin-react-require --save-dev
|
谢谢,这个问题解决了,能进入了,table显示还有其他问题,我再看看 |
如果样式有问题,可能是css-module的问题,需要配置一下。
|
谢谢 |
因为我原先有配置 |
原先的不动,或者加一个 exclude,'node_modules/rctui',再加一个配置 include 就好了
|
或者 test 里面加上path, test: /node_modules\/rctui\/**\/*\.scss$/,这样应该也可以的 |
最后还是不能用我原先抽离CSS的方式,不知为什么,两者都放上去也不行, |
我想问一下,如何单纯的将TABLE拿出来用,会涉及多少其他组件? |
比较简单的办法,fork 一下这个项目,把 src/index.js 只保留 Table,然后执行npm run build,编译一个只有Table的版本就好了。 |
谢谢 |
ERROR in ./src/views/mydesk/TraceList.js
Module not found: Error: Can't resolve 'rctui/DatepickerRange' in 'C:\Users\Harry\web develop\oa3test\src\views\mydesk'
@ ./src/views/mydesk/TraceList.js 39:23-55
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/higherOrders/Fetch.js
Module parse failed: Unexpected token (100:54)
You may need an appropriate loader to handle this file type.
| fetch = { url: fetch }
| }
| let { method = 'get', url, data, then, request, ...options } = fetch
| if (!request) {
| request = Refetch
@ ./node_modules/_rctui@0.7.20@rctui/Select/index.js 2:0-41
@ ./src/views/mydesk/TraceList.js
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/Table/Table.js
Module parse failed: Unexpected token (111:8)
You may need an appropriate loader to handle this file type.
| if (!Array.isArray(data)) {
| return (
|
|
| <td style={{textAlign: 'center'}} colSpan={columns.length + (onSelect ? 1 : 0)}>{data} @ ./node_modules/_rctui@0.7.20@rctui/Table/index.js 3:0-27
@ ./src/views/mydesk/TraceList.js
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/Select/Select.js
Module parse failed: Unexpected token (118:8)
You may need an appropriate loader to handle this file type.
| if (this.props.filterAble) {
| return (
|
| <input className={classnames(_input.input)}
| value={this.state.filter}
@ ./node_modules/_rctui@0.7.20@rctui/Select/index.js 6:0-29
@ ./src/views/mydesk/TraceList.js
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/higherOrders/FormItem.js
Module parse failed: Unexpected token (168:37)
You may need an appropriate loader to handle this file type.
|
| render () {
| let { name, readOnly, popover, ...props } = this.props
| const { controlProps, errors } = this.context
| const { result } = this.state
@ ./node_modules/_rctui@0.7.20@rctui/Select/index.js 3:0-47
@ ./src/views/mydesk/TraceList.js
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./src/views/mydesk/TraceList.js
Module not found: Error: Can't resolve 'rctui/DatepickerRange' in 'C:\Users\Harry\web develop\oa3test\src\views\mydesk'
@ ./src/views/mydesk/TraceList.js 39:23-55
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/higherOrders/Fetch.js
Module parse failed: Unexpected token (100:54)
You may need an appropriate loader to handle this file type.
| fetch = { url: fetch }
| }
| let { method = 'get', url, data, then, request, ...options } = fetch
| if (!request) {
| request = Refetch
@ ./node_modules/_rctui@0.7.20@rctui/Select/index.js 2:0-41
@ ./src/views/mydesk/TraceList.js
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/Table/Table.js
Module parse failed: Unexpected token (111:8)
You may need an appropriate loader to handle this file type.
| if (!Array.isArray(data)) {
| return (
|
|
| <td style={{textAlign: 'center'}} colSpan={columns.length + (onSelect ? 1 : 0)}>{data} @ ./node_modules/_rctui@0.7.20@rctui/Table/index.js 3:0-27
@ ./src/views/mydesk/TraceList.js
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/Select/Select.js
Module parse failed: Unexpected token (118:8)
You may need an appropriate loader to handle this file type.
| if (this.props.filterAble) {
| return (
|
| <input className={classnames(_input.input)}
| value={this.state.filter}
@ ./node_modules/_rctui@0.7.20@rctui/Select/index.js 6:0-29
@ ./src/views/mydesk/TraceList.js
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/higherOrders/FormItem.js
Module parse failed: Unexpected token (168:37)
You may need an appropriate loader to handle this file type.
|
| render () {
| let { name, readOnly, popover, ...props } = this.props
| const { controlProps, errors } = this.context
| const { result } = this.state
@ ./node_modules/_rctui@0.7.20@rctui/Select/index.js 3:0-47
@ ./src/views/mydesk/TraceList.js
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/Lazyload.js
Module parse failed: Unexpected token (32:13)
You may need an appropriate loader to handle this file type.
|
| if (Array.isArray(children)) {
| return
| } else {
| return Children.only(children)
@ ./src/views/mydesk/TraceList.js 43:16-41
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/higherOrders/Filter.js
Module parse failed: Unexpected token (32:28)
You may need an appropriate loader to handle this file type.
|
| render () {
| const { data, filter, ...props } = this.props
| return (
| <Component {...props}
@ ./node_modules/_rctui@0.7.20@rctui/Table/index.js 8:0-43
@ ./src/views/mydesk/TraceList.js
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/Input.js
Module parse failed: Unexpected token (32:58)
You may need an appropriate loader to handle this file type.
|
| render () {
| const { className, grid, type, size, readOnly, value, ...other } = this.props
| const props = {
| className: classnames(
@ ./src/views/mydesk/TraceList.js 33:13-35
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/higherOrders/Sort.js
Module parse failed: Unexpected token (37:20)
You may need an appropriate loader to handle this file type.
| render () {
| const state = this.state
| const { data, ...props } = this.props
| let sortData = isEmpty(state) ? data : this.sort(data, state)
|
@ ./node_modules/_rctui@0.7.20@rctui/Table/index.js 6:0-39
@ ./src/views/mydesk/TraceList.js
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/Filter.js
Module parse failed: Unexpected token (39:8)
You may need an appropriate loader to handle this file type.
| }
| return (
| <FormControl key={f.name} {...props}>
| { cloneElement(f.component, {name: f.name}) }
|
@ ./src/views/mydesk/TraceList.js 29:14-37
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/higherOrders/Pagination.js
Module parse failed: Unexpected token (54:26)
You may need an appropriate loader to handle this file type.
|
| render () {
| const { pagination, ...props } = this.props
| let pagi = this.getPagination(pagination)
|
@ ./node_modules/_rctui@0.7.20@rctui/Table/index.js 7:0-51
@ ./src/views/mydesk/TraceList.js
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/Select/format.js
Module parse failed: Unexpected token (69:11)
You may need an appropriate loader to handle this file type.
| }
|
| return <Component {...props} data={data} />
| }
|
@ ./node_modules/_rctui@0.7.20@rctui/Select/index.js 5:0-29
@ ./src/views/mydesk/TraceList.js
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
ERROR in ./node_modules/_rctui@0.7.20@rctui/higherOrders/ClickAway.js
Module parse failed: Unexpected token (69:8)
You may need an appropriate loader to handle this file type.
| render () {
| return (
| <Component {...this.props}
| open={this.state.open}
| onOpen={this.handleOpen}
@ ./node_modules/_rctui@0.7.20@rctui/Select/index.js 4:0-49
@ ./src/views/mydesk/TraceList.js
@ ./src/views/mydesk/All.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
The text was updated successfully, but these errors were encountered: