-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
旧项目中编译报错Unexpected character '#' #5215
Comments
hi @hlysf, welcome! |
遇到相同的问题,求解。去看了一下表层,应该是ml-matrix包升级后,@antv/layout依赖自动把ml-matrix升级到最新版本了,但是不知道要怎么打包才能识别这个包里的语法。 |
我在package.json中固定ml-matrix的版本了,你也可以试试 |
可以尝试使用 @babel/plugin-transform-private-methods 来转译该语法 |
已解决,感谢 |
|
|
1.如果@antv/g6版本package.json中为固定版本,也可以将ml-matrix版本设置为固定版本 2.vue工程建议使用transpileDependencies: ['ml-matrix'] 3.其他方案@babel/plugin-transform-private-methods来处理 |
@zhangkaidi 在其他地方看到的你说的第二个方案,我试了并不行,仍然报错,提示如下:
在自己的项目中固定 ml-matrix 也不行,因为 layout 使用了子依赖,结果仍然报错。 补充:通过 overrides/resolutions 强制依赖的版本号即可解决 |
问题描述
环境:
angular9、"@antv/g6": "4.5.0"
ml-matrix包更新到6.11.0后,编译失败
报错:
/node_modules/@antv/layout/node_modules/ml-matrix/src/symmetricMatrix.js 8:2
Module parse failed: Unexpected character '#' (8:2)
重现链接
xxx
重现步骤
编译项目
预期行为
编译成功
平台
屏幕截图或视频(可选)
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: