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

我本地 引用你这个uiw 说找不到模块是什么原因? #56

Closed
w3cui opened this issue Mar 19, 2018 · 12 comments
Closed

我本地 引用你这个uiw 说找不到模块是什么原因? #56

w3cui opened this issue Mar 19, 2018 · 12 comments

Comments

@w3cui
Copy link

w3cui commented Mar 19, 2018

错误信息

ERROR in ./src/Module/index.jsx
Module not found: Error: Can't resolve 'uiw' in 'G:\github\react\react-practice\react-dome\src\Module'
 @ ./src/Module/index.jsx 15:11-25
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

引用代码:

import React from 'react';
import { Router, Route, Link } from 'react-router';
import { Button } from 'uiw';
import Header from './Common/header';


class App extends React.Component {
  constructor(props){
    super(props);
    this.getAttribute = function(){};
    this.logo = "http:\//ww4.sinaimg.cn/thumb180/0069kQGBgy1foaj1sj8grj32c0340e81.jpg";
  };
  render() {
    return (
      <div>
       <Header></Header>
        <Button></Button>
        <div className="App-header">
          <img src={this.logo} className="App-logo" alt="logo" />
          <h1 className="App-title">Welcome to React</h1>
        </div>
        <p className="App-intro">
          To get started, edit <code>src/App.js</code> and save to reload.
        </p>
        {this.props.children}
      </div>
    );
  }
} 
export default App;

引用步骤:

cnpm install uiw --save

@jaywcjlove
Copy link
Member

@w3cui 你尝试清空 node_modules,使用 npm 安装 [email protected]

@w3cui
Copy link
Author

w3cui commented Mar 19, 2018

./node_modules/_uiw@1.7.0@uiw/lib/list/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @list:~"w-list";
|
| .@{List} {
@ ./node_modules/_uiw@1.7.0@uiw/lib/list/List.js 33:0-29
@ ./node_modules/_uiw@1.7.0@uiw/lib/list/index.js
@ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
@ ./src/Module/index.jsx
@ ./src/Routes/routes.jsx
@ ./src/main.jsx
@ multi ./src/main.jsx

好像能读取到了,但是报这个@符合的错! 我webpack里面@符号是定义的项目根目录是不是有影响?

@w3cui
Copy link
Author

w3cui commented Mar 19, 2018

我的webpack 里面配置了:
` resolve: {
// 解析模块请求的选项
// (不适用于对 loader 解析)

    modules: [
        "node_modules",
        path.resolve(__dirname, "app")
    ],
    // 用于查找模块的目录

    extensions: [".js", ".json", ".jsx", ".css"],
    // 使用的扩展名

    alias: {
        // 模块别名列表

        "@": APP_DIR
        // 起别名:"module" -> "new-module" 和 "module/path/file" -> "new-module/path/file"

    }
},`

是不是有影响?

@jaywcjlove
Copy link
Member

jaywcjlove commented Mar 19, 2018

@w3cui 你要在webpack中配置 less 解析

{
  test: /\.(css|less)$/,
  use: [
    require.resolve('style-loader'),
    {
      loader: require.resolve('css-loader'),
      options: {
        modules: true,
        localIdentName: '[name]-[hash:base64:5]',
        importLoaders: 1,
      },
    },
    {
      loader: require.resolve('postcss-loader'),
      options: {
        ident: 'postcss', // https://webpack.js.org/guides/migrating/#complex-options
        plugins: () => [
          require('postcss-flexbugs-fixes'),
          autoprefixer({
            browsers: [
              '>1%',
              'last 4 versions',
              'Firefox ESR',
            ],
            flexbox: 'no-2009',
          }),
          px2rem({
            rootValue: 100,
            selectorBlackList: ['html']
          })
        ],
      },
    },
    require.resolve('less-loader'),
  ]
}

@w3cui
Copy link
Author

w3cui commented Mar 19, 2018

@jaywcjlove

我这个配置了的我项目里面自己写的less

都能解析 这是我的配置需要怎么去修改?

module: { rules: [{ test: /\.js[x]?$/, use: [{ loader: "babel-loader", }] }, { test: /\.html$/, loader: 'html-loader' }, { test: /\.js$/, loader: 'babel-loader', include: [ APP_DIR ] }, { test: /\.css$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader?modules' }), include: [ APP_DIR ] }, { test: /\.less$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader?!less-loader' }), include: [ APP_DIR ] }, { test: /\.sass$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader?!sass-loader' }), include: [ APP_DIR ] }, { test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/, loader: 'url-loader', options: { limit: 10000, name: 'img/[name].[hash:7].[ext]' } }, { test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, loader: 'url-loader', options: { limit: 10000, name: 'media/[name].[hash:7].[ext]' } }, ] }

@jaywcjlove
Copy link
Member

jaywcjlove commented Mar 19, 2018

@w3cui sass 跟 less 冲突了?这个应该不可能的事情

@w3cui
Copy link
Author

w3cui commented Mar 19, 2018

我把sass清除了一样的还是报错!

ERROR in ./node_modules/[email protected]@uiw/lib/list/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @List:~"w-list";
|
| .@{List} {
 @ ./node_modules/[email protected]@uiw/lib/list/List.js 33:0-29
 @ ./node_modules/[email protected]@uiw/lib/list/index.js
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/copy-to-clipboard/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @copy-to-clipboard:~"w-copy-to-clipboard";
|
| .@{copy-to-clipboard} {
 @ ./node_modules/[email protected]@uiw/lib/copy-to-clipboard/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/form/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @form-cls: ~"w-form";
| @form-item-cls: ~"@{form-cls}-item";
|
 @ ./node_modules/[email protected]@uiw/lib/form/index.js 15:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/upload/style/dragger.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/upload/Dragger.js 33:0-31
 @ ./node_modules/[email protected]@uiw/lib/upload/index.js
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/button/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/button/Button.js 33:0-29
 @ ./node_modules/[email protected]@uiw/lib/button/index.js
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/radio/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/radio/index.js 19:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/checkbox/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/checkbox/index.js 15:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/card/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/card/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/tag/style/tag-group.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/tag/TagGroup.js 41:0-33
 @ ./node_modules/[email protected]@uiw/lib/tag/index.js
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/notification/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/notification/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/breadcrumb/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/breadcrumb/index.js 15:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/heat-map/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/heat-map/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/input-number/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/input-number/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/input/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/input/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/menu/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/menu/index.js 27:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/loading/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/loading/index.js 25:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/button/style/buttons-group.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/button/ButtonGroup.js 33:0-37
 @ ./node_modules/[email protected]@uiw/lib/button/index.js
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/table/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/table/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/tag/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/tag/Tag.js 37:0-29
 @ ./node_modules/[email protected]@uiw/lib/tag/index.js
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/paging/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/paging/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/select/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/select/index.js 19:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/switch/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/switch/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/alert/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/alert/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/message/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
| .w-message {
 @ ./node_modules/[email protected]@uiw/lib/message/index.js 26:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/tooltip/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
| .w-tooltip {
 @ ./node_modules/[email protected]@uiw/lib/tooltip/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/layout/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
| @import "./row.less";
 @ ./node_modules/[email protected]@uiw/lib/layout/index.js 15:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/date-picker/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
| @import './time-select.less';
 @ ./node_modules/[email protected]@uiw/lib/date-picker/index.js 30:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/modal/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
| @w-modal:~"w-modal";
 @ ./node_modules/[email protected]@uiw/lib/modal/index.js 15:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/tabs/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @w-tabs:~'w-tabs';
| .@{w-tabs} {
 @ ./node_modules/[email protected]@uiw/lib/tabs/index.js 15:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/icon/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "~uiw-iconfont/fonts/w-iconfont.css";
| .w-icon-spin:before {
|   animation: loading-circle 1s infinite linear;
 @ ./node_modules/[email protected]@uiw/lib/icon/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/steps/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @stepsPrefixClass:~"w-steps";
|
| .@{stepsPrefixClass} {
 @ ./node_modules/[email protected]@uiw/lib/steps/index.js 15:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/timestamp/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @timestamp:~"w-timestamp";
|
| .@{timestamp} {
 @ ./node_modules/[email protected]@uiw/lib/timestamp/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/affix/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-affix:~"w-affix";
|
| // .@{w-affix}{
 @ ./node_modules/[email protected]@uiw/lib/affix/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/badge/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-badge:~"w-badge";
| .@{w-badge} {
|   position: relative;
 @ ./node_modules/[email protected]@uiw/lib/badge/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/calendar/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-calendar:~"w-calendar";
|
| .@{w-calendar} {
 @ ./node_modules/[email protected]@uiw/lib/calendar/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/collapse/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-collapse: ~'w-collapse';
|
| .@{w-collapse} {
 @ ./node_modules/[email protected]@uiw/lib/collapse/index.js 15:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/divider/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-divider:~"w-divider";
|
| .@{w-divider} {
 @ ./node_modules/[email protected]@uiw/lib/divider/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/dropdown/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-dropdown:~"w-dropdown";
|
| .@{w-dropdown} {
 @ ./node_modules/[email protected]@uiw/lib/dropdown/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/progress/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-progress-prefix: ~"w-progress";
|
| .@{w-progress-prefix} {
 @ ./node_modules/[email protected]@uiw/lib/progress/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/rate/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-rate:~"w-rate";
| .@{w-rate} {
|   list-style: none;
 @ ./node_modules/[email protected]@uiw/lib/rate/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/tree/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-tree:~"w-tree";
|
| .@{w-tree} {
 @ ./node_modules/[email protected]@uiw/lib/tree/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/avatar/style/index.less
Module parse failed: Unexpected character '@' (2:0)
You may need an appropriate loader to handle this file type.
|
| @avatar-prefix-cls: ~"w-avatar";
|
| .@{avatar-prefix-cls} {
 @ ./node_modules/[email protected]@uiw/lib/avatar/index.js 37:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/carousel/style/index.less
Module parse failed: Unexpected character '@' (4:0)
You may need an appropriate loader to handle this file type.
| /*@import "~slick-carousel/slick/slick-theme.css";*/
|
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/[email protected]@uiw/lib/carousel/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/transition/style/index.less
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| .w-animate {
|   transition: all 0.3s ease;
|   &.is-down {
 @ ./node_modules/[email protected]@uiw/lib/transition/index.js 41:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/back-top/style/index.less
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| .w-back-top {
|   display: inline-block;
|   transition: opacity 0.2s linear 0s, visibility;
 @ ./node_modules/[email protected]@uiw/lib/back-top/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/input-password/style/index.less
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| .w-input-password.password-show.w-input-icon {
|   .event {
|     color: #0fa120;
 @ ./node_modules/[email protected]@uiw/lib/input-password/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/[email protected]@uiw/lib/slider/style/index.less
Module parse failed: Unexpected token (2:0)
You may need an appropriate loader to handle this file type.
|
| .w-slider {
|   width: 100%;
|   height: 4px;
 @ ./node_modules/[email protected]@uiw/lib/slider/index.js 11:0-29
 @ ./node_modules/[email protected]@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

@jaywcjlove
Copy link
Member

@w3cui 你的loader这样配置配置试一试?

{
    test: /\.(css|less)$/,
    use:[ 'style-loader','css-loader','less-loader'],
},

@w3cui
Copy link
Author

w3cui commented Mar 19, 2018

现在成功了!! 谢谢。。。
我想问一下:
我之前的写法怎么在我的项目里面写less就可以,导入uiw 后就报解析错误,这个是什么原因造成的??

@jaywcjlove
Copy link
Member

@w3cui 你的配置方法好像是 webpack1 or 2 遗留下的配置方法,可能是新的 less-loader 不兼容老的配置方法。

@w3cui
Copy link
Author

w3cui commented Mar 19, 2018

嗯! 好的

@jaywcjlove
Copy link
Member

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

2 participants