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]: css/module崩溃 #8387

Open
fangkyi03 opened this issue Nov 10, 2024 · 9 comments
Open

[Bug]: css/module崩溃 #8387

fangkyi03 opened this issue Nov 10, 2024 · 9 comments
Labels
bug Something isn't working need reproduction

Comments

@fangkyi03
Copy link

System Info

System:
OS: Windows 10 10.0.19044
CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz
Memory: 3.42 GB / 31.73 GB
Binaries:
Node: 16.20.2 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.19.4 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (119.0.2151.93)
Internet Explorer: 11.0.19041.1566

Details

 {
    test: /\.less$/,
    use: [
      {
        loader: 'less-loader',
      },
    ],
    type: 'css/module',
  },

这个type css/module语法有问题 在这个window系统上面 web编译以后会页面会崩溃

main.js:258 undefined factory E:\project\xxx\src\pages\demo\index.module.less
webpack_require @ main.js:258
fn @ main.js:425
eval @ E:\project\xxx\src\pages\demo\demo.js?b251:9
E:\project\biz-operation-web-pc\src\pages\demo\demo.js @ main.js:5
webpack_require @ main.js:260
fn @ main.js:425
eval @ E:\project\xxx\test.js?3efd:5
E:\project\xxxx\test.js @ main.js:20
webpack_require @ main.js:260
(anonymous) @ main.js:1661
(anonymous) @ main.js:1662
main.js:260 Uncaught TypeError: Cannot read properties of undefined (reading 'call')

Reproduce link

No response

Reproduce Steps

import style from './index.less';

在页面的任何一个地方 直接引入一个less文件就崩溃了

@fangkyi03 fangkyi03 added bug Something isn't working pending triage The issue/PR is currently untouched. labels Nov 10, 2024
@inottn
Copy link
Collaborator

inottn commented Nov 10, 2024

need reproduction demo

@fangkyi03
Copy link
Author

提供demo没有用 需要这个系统的才会出这个问题 因为demo里面的内容就是很简单的引入一个less文件 其他没了 只要引入就崩溃

@fangkyi03
Copy link
Author

如果使用type:'css'这种模式的话 程序不会崩溃 可以正常编译出来
但是如果使用import style from './index.less' 语法
或者文件名换成module.less
类型改成type:'css/auto' 就会出现上面一样的崩溃

@fangkyi03
Copy link
Author

公司3台window 一台window没有出现这个问题 唯一的问题就是antd编译的样式丢了
剩下的两台window都是上面同样的现象

@fangkyi03
Copy link
Author

fangkyi03 commented Nov 10, 2024

类型type:'css'
import './index.less';
这个不崩溃

改成
import style from './index.less';
崩溃

换成css/module
import style from './index.less';
崩溃

换成css/auto
import style from './index.module.less';
崩溃

@inottn
Copy link
Collaborator

inottn commented Nov 10, 2024

提供demo没有用 需要这个系统的才会出这个问题 因为demo里面的内容就是很简单的引入一个less文件 其他没了 只要引入就崩溃

I was unable to reproduce the issue on Windows 10. Maybe our configuration files or the code used for testing have some slight differences, but I’m not sure.

@fangkyi03
Copy link
Author

是否安装的是跟我同一个版本的系统呢?

@hardfist
Copy link
Contributor

@fangkyi03 你要不先提供个复现仓库吧

@LingyuCoder LingyuCoder added need reproduction and removed pending triage The issue/PR is currently untouched. labels Nov 11, 2024
Copy link
Contributor

Hello @fangkyi03, sorry we can't investigate the problem further without reproduction demo, please provide a repro demo by forking rspack-repro, or provide a minimal GitHub repository by yourself. Issues labeled by need reproduction will be closed if no activities in 14 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need reproduction
Projects
None yet
Development

No branches or pull requests

4 participants