Skip to content
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

使用react-ui过程中一直报错:You may need an appropriate loader to handle this file type. #102

Open
lyc94230 opened this issue Jul 13, 2017 · 4 comments

Comments

@lyc94230
Copy link

我是使用create-react-app自动创建的项目,在使用react-ui的过程中,一直提示报错:
./node_modules/rctui/Button.js
Module parse failed: D:\workspace\web\branches\test\app_huiyiabc\huiyi\source\web\node_modules\rctui\Button.js Unexpected token (31:56)
You may need an appropriate loader to handle this file type.
|
| render () {
| let { children, status, size, grid, tag, className, ...others } = this.props
|
| className = classnames(
Compiling...
Compiled with warnings.

我找到另一份作者的创建整个项目的说明文档,对比了一下所有要安装的模块,发现那些loader我都有安装,但是就是一直不能使用,报同一个错误。我想请问一下这个是什么问题,我该怎么解决呢?我要是刚开始接触react,不是很理解。谢谢!

@Lobos
Copy link
Owner

Lobos commented Jul 13, 2017

应该是webpack 配置问题,参考一下这个项目 https://github.com/Lobos/react-example

@lyc94230
Copy link
Author

首先谢谢你给我回复!但是我那个是create-react-app自动创建的项目,那个webpack配置文件好像被封装了,是必须要在webpack中配置吗?

@Lobos
Copy link
Owner

Lobos commented Jul 14, 2017

配置文件应该在config目录下面,要修改一下,不然webpack没法知道使用哪个loader

@longboy
Copy link

longboy commented Oct 19, 2017

我也遇到这种问题,怎么解决的?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants