页面【pages/index/index]错误:
Error: module 'pages/index/data/query.json.js' is not defined, require args is '/data/query.json'
at q (WASubContext.js?t=wechat&s=1735517540234&v=3.7.3:1)
at n (WASubContext.js?t=wechat&s=1735517540234&v=3.7.3:1)
at index.js? [sm]:2
at WASubContext.js?t=wechat&s=1735517540234&v=3.7.3:1
at _.runWith (WASubContext.js?t=wechat&s=1735517540234&v=3.7.3:1)
at q (WASubContext.js?t=wechat&s=1735517540234&v=3.7.3:1)
at appservice.js:1107
at doWhenAllScriptLoaded (getmainpackage.js:1156)
at Object.scriptLoaded (getmainpackage.js:1191)
at Object.<anonymous> (getmainpackage.js:1249)(env: Windows,mp,1.06.2409140; lib: 3.7.3) ## 我在index.js中,引用这个文件,格式如下:const
queryData = require('../../data/query.json'); index.js 的目录是工程根目录/pages/index/index.js;query.json的文件目录则是:根目录/data/query.json,所以,系统是怎么产生query.json.js这个文件的,该怎么修改?
从报错来看只支持require引用js文件。