Open Lazybin opened 4 months ago
嗯,这个问题似曾相识,是 pako 这个用到了 #ifdef xxx
,但是没有 endif 导致的对吧。
嗯,这个问题似曾相识,是 pako 这个用到了
#ifdef xxx
,但是没有 endif 导致的对吧。
我发现是pako包里有类似这样的注释
/*#ifdef NO_INIT_GLOBAL_POINTERS
static_l_desc.static_tree = static_ltree;
static_l_desc.extra_bits = extra_lbits;
static_d_desc.static_tree = static_dtree;
static_d_desc.extra_bits = extra_dbits;
static_bl_desc.extra_bits = extra_blbits;
#endif*/
我修改成
//修改后
//#ifdef NO_INIT_GLOBAL_POINTERS
static_l_desc.static_tree = static_ltree;
static_l_desc.extra_bits = extra_lbits;
static_d_desc.static_tree = static_dtree;
static_d_desc.extra_bits = extra_dbits;
static_bl_desc.extra_bits = extra_blbits;
//#endif
就可以了
清提供一个复现问题的单页面代码或者工程吧,我尝试修复下
不好意思 现在才看到 提供一个会报错的示例代码
<template>
<view>
<button @click="openDeviceText">
加载
</button>
</view>
</template>
<script setup>
import { PDFDocument, StandardFonts, rgb } from 'pdf-lib'
</script>
<style lang="scss"></style>
直接就会报错。
用了pdf-lib
库,他里面依赖了pako
包
用了有pako依赖的包。 编译运行的时候报这个错误: [plugin:commonjs--resolver] Unbalanced delimiter found in string
参考了:
4524
对esbuildPrePlugin.js进行了修改,编译h5可以通过,但是编译app又会报这个错