ant-design / ant-design/pro-chat

🧐[问题] ios打开syntaxError: Invalid regular expression: invalid group specifier name

Open
#321 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
898
Forks
116
PR merge metrics
No merged PRs in 30d

Description

### 🧐 问题描述
使用umi新建的项目,集成了proChat,pc端使用正常,在手机端报错,syntaxError: Invalid regular expression: invalid group specifier name。手机端尝试了谷歌浏览器、微信、钉钉中打开,都是相同错误。

SyntaxError: Invalid regular expression: invalid group specifier name
./node_modules/regex/dist/regex.mjs
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:343315:24
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/oniguruma-to-js/dist/shared/oniguruma-to-js.2969e22d.mjs
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:339565:82
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/oniguruma-to-js/dist/index.mjs
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:339455:113
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/@shikijs/engine-javascript/dist/index.mjs
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:281018:92
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/@shikijs/core/dist/index.mjs
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:279081:103
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/shiki/dist/bundle-web.mjs
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:344267:90
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/@ant-design/pro-editor/es/Highlight/hooks/useShiki.js
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:64088:93
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/@ant-design/pro-editor/es/Highlight/components/HighLighter/index.js
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:63837:92
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/@ant-design/pro-editor/es/Snippet/index.js
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:66447:110
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/@ant-design/pro-editor/es/Markdown/CodeBlock.js
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:66121:78
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/@ant-design/pro-editor/es/Markdown/index.js
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:66200:87
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/@ant-design/pro-chat/es/MessageModal/index.js
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:58691:99
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/@ant-design/pro-chat/es/EditableMessage/index.js
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:57829:90
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/@ant-design/pro-chat/es/ChatItem/components/MessageContent.js
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:56928:93
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/@ant-design/pro-chat/es/ChatItem/index.js
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:57051:103
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/@ant-design/pro-chat/es/index.js
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:63012:86
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
./node_modules/.cache/mfsu/mf-va_@ant-design_pro-chat.js
http://10.96.8.74:8000/mf-dep____vendor.625dbecf.js:884:174
__webpack_require__
http://10.96.8.74:8000/mf-va_remoteEntry.js:740:46
(anonymous function)
webpack:/webpack/runtime/remotes loading:1397
1394 | var onFactory = function(factory) {
1395 | data.p = 1;
1396 | __webpack_require__.m[id] = function(module) {
> 1397 | module.exports = factory();
| ^ 1398 | }
1399 | };
1400 | handleFunction(__webpack_require__, data[2], 0, 0, onExternal, 1);
View compiled
(anonymous function)
webpack:/webpack/runtime/react refresh:6
3 | options.factory = function (moduleObject, moduleExports, webpackRequire) {
4 | __webpack_require__.$Refresh$.setup(options.id);
5 | try {
> 6 | originalFactory.call(this, moduleObject, moduleExports, webpackRequire);
| ^ 7 | } finally {
8 | if (typeof Promise !== 'undefined' && moduleObject.exports instanceof Promise) {
9 | options.module.exports = options.module.exports.then(
View compiled
__webpack_require__
./webpack/bootstrap:24
21 | var execOptions = { id: moduleId, module: module, factory: __webpack_modules__[moduleId], require: __webpack_require__ };
22 | __webpack_require__.i.forEach(function(handler) { handler(execOptions); });
23 | module = execOptions.module;
> 24 | execOptions.factory.call(module.exports, module, module.exports, execOptions.require);
| ^ 25 | } catch(e) {
26 | module.error = e;
27 | throw e;
View compiled
▼ 3 stack frames were expanded.
fn
webpack:/webpack/runtime/hot module replacement:62
./src/pages/antProChat/index.tsx
http://10.96.8.74:8000/p__antProChat__index.async.js:17:99
(anonymous function)
webpack:/webpack/runtime/react refresh:6
▲ 3 stack frames were expanded.
__webpack_require__
./webpack/bootstrap:24
21 | var execOptions = { id: moduleId, module: module, factory: __webpack_modules__[moduleId], require: __webpack_require__ };
22 | __webpack_require__.i.forEach(function(handler) { handler(execOptions); });
23 | module = execOptions.module;
> 24 | execOptions.factory.call(module.exports, module, module.exports, execOptions.require);
| ^ 25 | } catch(e) {
26 | module.error = e;
27 | throw e;
View compiled
fn
webpack:/webpack/runtime/hot module replacement:62
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error. Click the 'X' or hit ESC to dismiss this message.

### 💻 示例代码

https://github.com/qq382724935/prochat.git
### 🚑 其他信息
手机:ios 14
ios系统版本:16.1.2

![1](https://github.com/user-attachments/assets/19f20f53-cc16-47a4-a4e7-f7050c762c5e)
![2](https://github.com/user-attachments/assets/d65aeb50-1eb1-461a-bb60-2d7dcf4d2c27)
![3](https://github.com/user-attachments/assets/b3c7f105-485f-4d1c-9628-7baa17224952)
![4](https://github.com/user-attachments/assets/4ac382e1-0f70-4c3f-9572-74e000f024c7)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with src/pages/antProChat/index.tsx and the stack trace through @ant-design/pro-editor/es/Highlight/hooks/useShiki.js, shiki, @shikijs/engine-javascript, oniguruma-to-js, and regex. Reproduce on iOS 16.1.2 using the linked prochat project, then determine the affected dependency path and verify that the chat page loads without the regular-expression error on the reported browsers.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, react, typescript
Domain
frontend, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.