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

🐛[BUG]Build 时提示 SettingDrawer/index.less 语法错误 #4454

Closed
xyy94813 opened this issue Jan 12, 2022 · 3 comments
Closed

🐛[BUG]Build 时提示 SettingDrawer/index.less 语法错误 #4454

xyy94813 opened this issue Jan 12, 2022 · 3 comments

Comments

@xyy94813
Copy link

xyy94813 commented Jan 12, 2022

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🐛 bug 描述

正常使用构建时提示 less 语法错误。

/Users/alex/Documents/workspace/honeyguide/node_modules/@ant-design/pro-layout/es/components/SettingDrawer/index.js: postcss-nested: /Users/alex/Documents/workspace/honeyguide/node_modules/@ant-design/pro-layout/es/components/SettingDrawer/index.less:72:7: Unexpected '/'. Escaping special characters with \ may help.

删除本地文件中该行注释后能正常运行

📷 复现步骤

CRA v5 项目 yarn start

🏞 期望结果

正常构建并运行

💻 复现代码

import ProLayout, { DefaultFooter } from '@ant-design/pro-layout';

© 版本信息

  • ProComponents 版本:
  • 浏览器环境:
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
  • 开发环境

🚑 其他信息

@xyy94813
Copy link
Author

xyy94813 commented Jan 12, 2022

貌似与 @dr.pogodin/babel-plugin-react-css-modules 有关,移除该 babel plugin 后运行正常

@xyy94813
Copy link
Author

[
        '@dr.pogodin/babel-plugin-react-css-modules',
        {
          filetypes: {
            '.less': {
              syntax: 'postcss-less',
              plugins: ['postcss-nested'],
            },
          },
          generateScopedName: localIdentName,
        },
      ],

postcss-less v6 存在的 bug 降级至 v5 后正常

@xyy94813
Copy link
Author

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

1 participant