收藏
回答

自动预览时报错,Error: 非法的文件,错误信息:invalid file,如何解决?

发现编译时报错,具体的代码片段是以下

function isDraftable(value) {
  if (!value)
    return false;
  return isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);
}


其中!!value.constructor?.[DRAFTABLE]使用了es6的 ? 语法,但本地设置已开启JS编译转ES5

最后一次编辑于  2023-09-07
回答关注问题邀请回答
收藏

3 个回答

  • 工号9527
    工号9527
    2023-09-07

    你这个文件有多大?

    2023-09-07
    有用
    回复 2
    • lin.t
      lin.t
      2023-09-08
      913 KB
      2023-09-08
      回复
    • lin.t
      lin.t
      2023-09-11
      升级到1.06版本可正常预览
      2023-09-11
      回复
  • Fumi_Scorpio
    Fumi_Scorpio
    02-06

    message:预览 Error: 非法的文件,错误信息:source package include invalid file : /pages/index/index.wxml [20250206 20:09:34][wxcf569f9b8a5736be]

    appid: wxcf569f9b8a5736be

    openid: o6zAJs1wIpatYBcP3EbFbmVlWfy8

    ideVersion: 1.06.2412050

    osType: win32-x64

    time: 2025-02-06 20:09:36

    02-06
    有用
    回复
  • 李擘
    李擘
    2024-03-05

    message:预览 Error: 非法的文件,错误信息:invalid file: webgl.wasm.framework.unityweb.js, 3:0, SyntaxError: Unexpected token varvar tuanjieFramework = (() => { [20240305 13:35:23][wx5825503858a89be4]

    appid: wx5825503858a89be4

    openid: o6zAJswBr5w_sGldkOJ1ZEWCGfwo

    ideVersion: 1.06.2403042

    osType: win32-x64

    time: 2024-03-05 13:35:25

    2024-03-05
    有用
    回复 1
    • 阳哥
      阳哥
      2024-06-07
      同样问题,请问解决了吗?
      2024-06-07
      回复
登录 后发表内容