Closed cweijan closed 4 months ago
I solved it by upgrading the node version of CI, but errors occurred due to unplugin when the code was not changed, which was frustrating.
If it is not compatible with the old version of nodejs, the unplugin version should be upgraded to 2.x
更新node版本到16.20.0不再报语法错误
我更新到 16.20.2 构建成功了
一样的问题 是因为使用了||=逻辑或赋值语法 需要Node v15.0.0以上支持 但是不向下兼容不理解 对于某些特定场景无法随意切换Node版本,切换成本较高
如果使用yarn的话 可以在package.json中添加如下配置解决
"resolutions": {
"unplugin": "1.7.1"
},
我们也是node不能轻易切换,遇到这个问题了
我们也是不能切换node版本。 直接在问题项目中安装 unplugin@1.7.1 就可以了。 它会把node_modules里的 unplugin 覆盖掉。
我才发现这个1.8.0版本是在不到24小时前发布的, 难怪这帖这么热闹, 我刚好拿起了我很久没维护的项目🤣.
这个属于破坏性变更了吧
@antfu Maybe we should release a new version v1.8.1, ASAP?
In fact, since the first version of unplugin, the minimum supported version has been node v16. However, it seems that we did not specify this in the documentation. Also considering that currently there seem to be many users of unplugin still on node 14.
Therefore, we have decided to lower the minimum supported version to v14 and will note this in the documentation. We will drop support for v14 when releasing unplugin v2 in the future.
Environment
nodejs14
Reproduction
Build using nodejs14.
Describe the bug
The new code cannot be executed on nodejs14 because logical OR is used.
Additional context
No response
Logs