rollup打包报错“semantic error TS2802”

rollup版本:2.79.1;nodejs:16.16.0;typescript:5.1.6

错误信息

Error: D:/**/*.ts(158,32): semantic error TS2802: Type 'StyleSheetList' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.

修改tsconfig.json配置,增加"lib": ["es2015"]配置

{
  "files": [],
  "references": [
    {
      "path": "./tsconfig.node.json"
    },
    {
      "path": "./tsconfig.app.json"
    },
    {
      "path": "./tsconfig.vitest.json"
    }
  ],
  "compilerOptions": {
    "downlevelIteration": true,
    "lib": ["es2015"],
  }
}

源代码可参考:vue3-print-ts (gitee.com)

相关推荐

  1. rollup打包“semantic error TS2802

    2023-12-10 12:40:03       58 阅读
  2. Qt项目打包

    2023-12-10 12:40:03       27 阅读
  3. QT C2872: “byte“: 不明确的符号

    2023-12-10 12:40:03       22 阅读
  4. 华为广告打包,问题思考

    2023-12-10 12:40:03       32 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2023-12-10 12:40:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2023-12-10 12:40:03       100 阅读
  3. 在Django里面运行非项目文件

    2023-12-10 12:40:03       82 阅读
  4. Python语言-面向对象

    2023-12-10 12:40:03       91 阅读

热门阅读

  1. 4-Docker命令之docker rename

    2023-12-10 12:40:03       44 阅读
  2. JVM常用调优参数

    2023-12-10 12:40:03       58 阅读
  3. 信息学奥赛一本通1851:【08NOIP提高组】笨小猴

    2023-12-10 12:40:03       59 阅读
  4. Git使用

    Git使用

    2023-12-10 12:40:03      60 阅读
  5. sql2005日志文件过大如何清理

    2023-12-10 12:40:03       56 阅读
  6. xtu oj 1255 勾股数

    2023-12-10 12:40:03       54 阅读
  7. Django视图

    2023-12-10 12:40:03       50 阅读
  8. 使用Python和MoviePy库进行视频人脸追踪和打马赛克

    2023-12-10 12:40:03       59 阅读
  9. <HarmonyOS第一课>应用服务上架【课后考核】

    2023-12-10 12:40:03       71 阅读
  10. Python运算符

    2023-12-10 12:40:03       69 阅读