Skip to content

chore(deps): cannot find module 'less-loader'#11620

Open
Taoister39 wants to merge 1 commit intoant-design:masterfrom
Taoister39:master
Open

chore(deps): cannot find module 'less-loader'#11620
Taoister39 wants to merge 1 commit intoant-design:masterfrom
Taoister39:master

Conversation

@Taoister39
Copy link

@Taoister39 Taoister39 commented Jan 30, 2026

$ yarn dev
yarn run v1.22.22
$ npm run start:dev

> [email protected] start:dev
> cross-env UMI_ENV=dev MOCK=none max dev

😄 Hello PRO
info  - [你知道吗?] @umijs/max 是蚂蚁内网框架 Bigfish 的对外版本。
info  - [plugin: ./node_modules/@umijs/preset-umi/dist/features/utoopack/utoopack] Using @utoo/[email protected]
Using openapi Plugin
info  - Umi v4.6.25
info  - Preparing...
  App listening at:
  - Local:   http://localhost:8000
  - Network: http://172.18.1.103:8000
2026-01-30 17:58:18.132  INFO endpoint_write_to_disk: Cleaning dist directory: /Volumes/MacDev/ant-design-pro/dist
2026-01-30 17:58:18.177  INFO endpoint_write_to_disk: Dist directory cleaned successfully
ModuleBuildError: ./src/global.less
Error evaluating Node.js code
Error: Cannot find module 'less-loader'
Require stack:
- /Volumes/MacDev/ant-design-pro/node_modules/@utoo/pack/cjs/.turbopack/_turbopack__runtime.js
- /Volumes/MacDev/ant-design-pro/node_modules/@utoo/pack/cjs/.turbopack/webpack-loaders.js
    [at Function._resolveFilename (node:internal/modules/cjs/loader:1401:15)]
    [at Function.resolve (node:internal/modules/helpers:145:19)]
    at externalRequire.resolve (turbopack:///[turbopack]/shared-node/base-externals-utils.ts:56:18) [/Volumes/MacDev/ant-design-pro/node_modules/@utoo/pack/cjs/.turbopack/_turbopack__runtime.js:554:20]
    at turbopack:///[turbopack-node]/transforms/webpack-loaders.ts:466:50 [/Volumes/MacDev/ant-design-pro/node_modules/@utoo/pack/cjs/.turbopack/_root-of-the-server___4aea6471.js:882:86]
    [at <anonymous>]
    at turbopack:///[turbopack-node]/transforms/webpack-loaders.ts:465:37 [/Volumes/MacDev/ant-design-pro/node_modules/@utoo/pack/cjs/.turbopack/_root-of-the-server___4aea6471.js:881:41]
    [at <anonymous>]
    at transform (turbopack:///[turbopack-node]/transforms/webpack-loaders.ts:158:10) [/Volumes/MacDev/ant-design-pro/node_modules/@utoo/pack/cjs/.turbopack/_root-of-the-server___4aea6471.js:630:12]
    at run (turbopack:///[turbopack-node]/worker_thread/evaluate.ts:42:27) [/Volumes/MacDev/ant-design-pro/node_modules/@utoo/pack/cjs/.turbopack/_root-of-the-server___993d59f9.js:215:33]


    at processIssues (/Volumes/MacDev/ant-design-pro/node_modules/@utoo/pack-shared/cjs/utils.js:38:15)
    at /Volumes/MacDev/ant-design-pro/node_modules/@utoo/pack/cjs/core/hmr.js:150:44
    at async Promise.all (index 0)
    at async handleEntrypointsSubscription (/Volumes/MacDev/ant-design-pro/node_modules/@utoo/pack/cjs/core/hmr.js:149:13)
✨  Done in 21.13s.

Summary by CodeRabbit

发行说明

  • 杂务
    • 更新开发依赖项配置,引入 less-loader 以支持样式表处理。
    • 调整开发工具依赖,优化项目构建工具链。

✏️ Tip: You can customize this high-level summary in your review settings.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jan 30, 2026
@github-actions
Copy link

⚡️ Deploying PR Preview...

@gemini-code-assist
Copy link

Summary of Changes

Hello @Taoister39, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical build failure encountered during local development, where the less-loader module could not be found. By explicitly adding less-loader to the project's development dependencies, the PR ensures that the necessary tooling for processing Less stylesheets is available, thereby stabilizing the development environment and allowing the project to compile and run as expected. The change also includes minor dependency list reordering for consistency.

Highlights

  • Dependency Resolution: Added less-loader to devDependencies to resolve a ModuleBuildError that occurred during the development build process, specifically 'Error: Cannot find module 'less-loader''.
  • Dependency Management: Reorganized existing devDependencies entries for @biomejs/biome and @types/node to maintain alphabetical order within the package.json file.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

工作流程

本次提交修改了 package.json,调整了项目的开发依赖。新增了 less-loader,移除了 biome 和 @types/node,保持 umi-serve 依赖不变。总计改动 4 行新增、3 行删除。

变更内容

组件 / 文件(s) 概述
依赖配置
package.json
在 devDependencies 中新增 less-loader ^12.3.0;移除 biome ^2.1.1 和 @types/node ^25.0.3;umi-serve ^1.9.11 保持不变。

预估代码审查工作量

🎯 1 (极简) | ⏱️ ~3 分钟

诗歌

🐰 依赖迎新客,less-loader 驾到,
biome 挥手告别,项目更轻妙,
构建工具优化,开发效率高,
版本管理齐整,代码编译好!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR标题准确反映了主要变更——添加less-loader依赖以解决模块缺失问题,与package.json中引入less-loader ^12.3.0的改动完全对应。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedless-loader@​12.3.09910010086100

View full report

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses the Cannot find module 'less-loader' error by adding the missing dependency. The change is functional and resolves the issue described. However, the commit also includes manual re-sorting of other dependencies within package.json, which makes the change less focused and harder to review. I've added a comment suggesting to separate these concerns for better repository history and maintainability.

"husky": "^9.1.7",
"jest": "^30.0.4",
"jest-environment-jsdom": "^30.0.5",
"less-loader": "^12.3.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While adding less-loader is the correct fix, this pull request also moves other dependencies (@biomejs/biome and @types/node) within the devDependencies list. Mixing dependency additions with manual sorting makes the commit's purpose unclear and the diff noisy. For better maintainability, it's recommended to keep commits focused on a single change. Please consider reverting the reordering and only adding less-loader in this PR. Dependency sorting can be handled in a separate commit, ideally using an automated tool.

@dosubot dosubot bot added the dependencies Pull requests that update a dependency file label Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant