ant-design / pro-chat

🤖 Components Library for Quickly Building LLM Chat Interfaces.
https://pro-chat.antdigital.dev
MIT License
737 stars 96 forks source link

🧐[问题]Webpack5编译报错 #326

Open jasonlbw opened 1 month ago

jasonlbw commented 1 month ago

🧐 问题描述

Node:18.17.0 Webpack:5.95.0 JS编译配置信息:

rules: [
      /* config.module.rule('js') */
      {
        test: /\.(j|t|mj)sx?$/,
        type: 'javascript/auto',
        include: [
          /node_modules\/@ant-design\/pro-chat\//,
          /node_modules\/@ant-design\/pro-editor\//,
          /node_modules\/_@ant-design_pro-editor\//,
          /node_modules\/react-markdown\//,
        ],
        exclude: [
          /node_modules/
        ],
        use: [
          /* config.module.rule('js').use('esbuild') */
          {
            loader: 'esbuild-loader',
            options: {
              loader: 'tsx',
              target: [
                'es2018',
                'chrome90',
                'edge90',
                'firefox90',
                'safari13'
              ]
            }
          },
          /* config.module.rule('js').use('dynamic-import') */
          {
            loader: '@ali/dynamic-import-loader',
            options: {
              importOptions: [
                {
                  libraryName: 'antd',
                  libraryDirectory: 'es',
                  style: true
                },
                {
                  libraryName: '@alifd/next',
                  libraryDirectory: 'es',
                  style: true
                }
              ]
            }
          }
        ],
        resolve: {
          fullySpecified: false
        }
      }
]

报错信息: image

💻 示例代码

🚑 其他信息

AmAzing129 commented 4 weeks ago

缺少更多信息,但从截图来看应该是 immer 版本问题 https://github.com/immerjs/immer/issues/901 需要 pro-editor 升级 可以尝试 package.json.overrides