1***@qq.com
1***@qq.com
  • 发布:2025-06-20 22:18
  • 更新:2025-06-20 22:18
  • 阅读:20

【报Bug】编译到app会报错,当在renderjs中使用bigint等新特性

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 11 23H2

HBuilderX类型: 正式

HBuilderX版本号: 4.66

手机系统: Android

手机系统版本号: Android 11

手机厂商: OPPO

手机机型: Reno5

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
<template>  
    <view class="main-container">  
        <view id="myMapViews" style="height: 100%;width: 100%;" />  
    </view>  
</template>  

<script module="myMapViews" lang="renderjs">  
    const aa = 123n  
    // import Map from "@arcgis/core/Map"  
    // import MapView from "@arcgis/core/views/MapView"  
    // export default {  
    //  name: 'myMapView',  
    //  data() {  
    //      return {};  
    //  },  
    //  mounted() {  
    //      this.createMapView()  
    //  },  
    //  methods: {  
    //      createMapView() {  
    //          const map = new Map({  
    //            basemap: 'dark-gray',  
    //          })  

    //          const mapView = new MapView({  
    //            map,  
    //            container: 'myMapViews',  
    //            center: [102.92934063304513, 25.102234987110343],  
    //            zoom: 3,  
    //          })  
    //      }  
    //  }  
    // }  
</script>  

<style>  
    .main-container {  
        width: 100vw;  
        height: 100vh;  
    }  
</style>

操作步骤:

Hbuilder X 4.66 创建新项目“uni-app”+“默认模板”+Vue3。(不选择uni app x)
在index.vue中复制代码(其实只需在renderjs中输入const aa = 123n,这是上一个帖子的示例)

<template>  
    <view class="main-container">  
        <view id="myMapViews" style="height: 100%;width: 100%;" />  
    </view>  
</template>  

<script module="myMapViews" lang="renderjs">  
    const aa = 123n  

</script>  

<style>  
    .main-container {  
        width: 100vw;  
        height: 100vh;  
    }  
</style>

将其运行到APP基座

预期结果:

正常编译

实际结果:

<stdin>:2:12: ERROR: Big integer literals are not available in the configured target environment ("es2015")

bug描述:

在Hbuilder X 4.66中使用<script module="xxx" lang="renderjs">,
在renderjs中写const aa = 123n,然后运行到APP
日志:<stdin>:2:12: ERROR: Big integer literals are not available in the configured target environment ("es2015")

操作场景:
本来是想使用arcgis for js实现地图展示,但是在APP端编译时就提示Big integer literals are not available in the configured target environment ("es2015")等消息。
然后查找解决方案:https://ask.dcloud.net.cn/question/180135
这是2023年10月的帖子,指出“HBuilderX 3.97.2023110504-alpha 已修复。”
但是当前我在4.66版本无法执行

2025-06-20 22:18 负责人:无 分享
已邀请:

要回复问题请先登录注册