{"action":"created","issue":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/10485","repository_url":"https://api.github.com/repos/ant-design/ant-design","labels_url":"https://api.github.com/repos/ant-design/ant-design/issues/10485/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/10485/comments","events_url":"https://api.github.com/repos/ant-design/ant-design/issues/10485/events","html_url":"https://github.com/ant-design/ant-design/issues/10485","id":322574149,"number":10485,"title":"import 'antd/dist/antd.less'报错，样式无法加载","user":{"login":"wangjianjun0730","id":13996978,"avatar_url":"https://avatars2.githubusercontent.com/u/13996978?v=4","gravatar_id":"","url":"https://api.github.com/users/wangjianjun0730","html_url":"https://github.com/wangjianjun0730","followers_url":"https://api.github.com/users/wangjianjun0730/followers","following_url":"https://api.github.com/users/wangjianjun0730/following{/other_user}","gists_url":"https://api.github.com/users/wangjianjun0730/gists{/gist_id}","starred_url":"https://api.github.com/users/wangjianjun0730/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangjianjun0730/subscriptions","organizations_url":"https://api.github.com/users/wangjianjun0730/orgs","repos_url":"https://api.github.com/users/wangjianjun0730/repos","events_url":"https://api.github.com/users/wangjianjun0730/events{/privacy}","received_events_url":"https://api.github.com/users/wangjianjun0730/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-13T08:15:58Z","updated_at":"2018-05-13T08:16:00Z","closed_at":null,"author_association":"NONE","body":"- [ ] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.\r\n\r\n### Version\r\n3.5.1\r\n\r\n### Environment\r\n电脑系统版本：macOS High Sierra 10.13.4/浏览器版本：Google Chrome  66.0.3359.139（正式版本）/node v10.1.0 npm:6.0.1\r\n\r\n### Reproduction link\r\n[https://github.com/wangjianjun0730/test](https://github.com/wangjianjun0730/test)\r\n\r\n### Steps to reproduce\r\n1.使用的脚手架是react-cavalier-cli\r\n2.创建步骤：\r\n2.1:下载脚手架：npm i react-cavalier-cli -g\r\n2.2:创建项目：react-cavalier init <项目名称>\r\n2.3:安装蚂蚁金服组件库：npm install antd babel-plugin-import --save\r\n2.4:项目目录(<项目名称>/src/container/App/index.js)首页导入:\r\n```\r\nimport 'antd/dist/antd.less'\r\nimport {Table} from 'antd'\r\n.........\r\n\r\nrender() {\r\n\r\n    return (\r\n      <div className=\"App\">\r\n        <header className=\"App-header\">\r\n          <img src={logo} className=\"App-logo\" alt=\"logo\"/>\r\n          <h1 className=\"App-title\">Welcome to React</h1>\r\n        </header>\r\n        <Table dataSource={dataSource} columns={columns}/>\r\n      </div>\r\n    );\r\n  }\r\n\r\n\r\n```\r\n报下列错误：\r\n```\r\nFailed to compile.\r\n\r\n./node_modules/antd/dist/antd.less\r\nModule build failed: \r\n\r\n// https://github.com/ant-design/ant-motion/issues/44\r\n.bezierEasingMixin();\r\n^\r\nInline JavaScript is not enabled. Is it set in your options?\r\n      in /Users/wangjianjune/test/node_modules/antd/lib/style/color/bezierEasing.less (line 110, column 0)\r\n\r\n\r\n```\r\n\r\n\r\n### What is expected?\r\n表格样式能正常加载\r\n\r\n### What is actually happening?\r\n不写import 'antd/dist/antd.less'这行代码，数据能展示，但表格线条及样式加载不出来。加了这行代码则js报错，无法正常启动。\r\n\r\n---\r\n我是不是少操作了什么？react-cavalier-cli这个脚手架是创建的工程基于`create-react-app` `webpack3.x` `React16.x`搭建而成。所有的打包构建都遵循`webpack3.x`的轻量化原则，支持多端(native，web)输出，并自带serviceWorker（PWA）做纯web端的简单离线处理。可使用`yarn`安装，搭配`Jest`进行单元测试。另外,less和less-loader都用过npm install less less-loader更新到最新。\r\n\r\n\r\n<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->"},"comment":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/comments/388609562","html_url":"https://github.com/ant-design/ant-design/issues/10485#issuecomment-388609562","issue_url":"https://api.github.com/repos/ant-design/ant-design/issues/10485","id":388609562,"user":{"login":"ant-design-bot","id":26566442,"avatar_url":"https://avatars0.githubusercontent.com/u/26566442?v=4","gravatar_id":"","url":"https://api.github.com/users/ant-design-bot","html_url":"https://github.com/ant-design-bot","followers_url":"https://api.github.com/users/ant-design-bot/followers","following_url":"https://api.github.com/users/ant-design-bot/following{/other_user}","gists_url":"https://api.github.com/users/ant-design-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/ant-design-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ant-design-bot/subscriptions","organizations_url":"https://api.github.com/users/ant-design-bot/orgs","repos_url":"https://api.github.com/users/ant-design-bot/repos","events_url":"https://api.github.com/users/ant-design-bot/events{/privacy}","received_events_url":"https://api.github.com/users/ant-design-bot/received_events","type":"User","site_admin":false},"created_at":"2018-05-13T08:15:59Z","updated_at":"2018-05-13T08:15:59Z","author_association":"NONE","body":"Translation of this issue:\n\n<hr/>\n\n## import 'antd/dist/antd.less' reported error, style could not be loaded\n\n- [] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.\r\n\r\n### Version\r\n3.5.1\r\n\r\n### Environment\r\nComputer system version: macOS High Sierra 10.13.4 / browser version: Google Chrome 66.0.3359.139 (formal version) / node v10.1.0 npm: 6.0.1\r\n\r\n### Reproduction link\r\n[https://github.com/wangjianjun0730/test] (https://github.com/wangjianjun0730/test)\r\n\r\n### Steps to reproduce\r\n1. The used scaffold is react-cavalier-cli\r\n2. Create steps:\r\n2.1: Download Scaffolding: npm i react-cavalier-cli -g\r\n2.2: Create project: react-cavalier init <project name>\r\n2.3: Install Ant Financial Component Library: npm install antd babel-plugin-import --save\r\n2.4: Project Directory (<Project Name>/src/container/App/index.js) Home Page Import:\r\n```\r\nImport 'antd/dist/antd.less'\r\nImport {Table} from 'antd'\r\n.........\r\n\r\nRender() {\r\n\r\n    Return (\r\n      <div className=\"App\">\r\n        <header className=\"App-header\">\r\n          <img src={logo} className=\"App-logo\" alt=\"logo\"/>\r\n          <h1 className=\"App-title\">Welcome to React</h1>\r\n        </header>\r\n        <Table dataSource={dataSource} columns={columns}/>\r\n      </div>\r\n    );\r\n  }\r\n\r\n\r\n```\r\nReport the following error:\r\n```\r\nFailed to compile.\r\n\r\n./node_modules/antd/dist/antd.less\r\nModule build failed:\r\n\r\n// https://github.com/ant-design/ant-motion/issues/44\r\n.bezierEasingMixin();\r\n^\r\nInline JavaScript is not enabled. Is it set in your options?\r\n      In /Users/wangjianjune/test/node_modules/antd/lib/style/color/bezierEasing.less (line 110, column 0)\r\n\r\n\r\n```\r\n\r\n\r\n### What is expected?\r\nTable style can load normally\r\n\r\n### What is actually happening?\r\nDo not write the import 'antd/dist/antd.less' line of code, data can be displayed, but the table lines and styles are not loaded. Add this line of code js error, can not start properly.\r\n\r\n---\r\nAm I operating less? The scaffolding of react-cavalier-cli is to create a project based on `create-react-app` `webpack3.x` `React16.x`. All packaging builds follow the lightweight principle of `webpack3.x`, supports native (web) output, and comes with serviceWorker (PWA) for simple off-line processing on the pure web side. Use `yarn` for installation and `Jest` for unit testing. In addition, less and less-loaders are updated to the latest with npm install less less-loader."}}
{"actor":{"display_login":"ant-design-bot"}}