2.0.8 require脚本报错

load script […/…/…/build/wechatgame/libs/weapp-adapter/window] failed : Error: Cannot find module ‘…/…/…/build/wechatgame/libs/weapp-adapter/window’
at Module._resolveFilename (module.js:470:15)
at Function.Module._resolveFilename [as _resolveFilenameVendor] (E:\IMI4197\Software\CocosCreator_v2.0.8\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.s._resolveFilename (E:\IMI4197\Software\CocosCreator_v2.0.8\resources\app.asar\editor\page\project-scripts.js:1:941)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.cc.require (E:\IMI4197\Software\CocosCreator_v2.0.8\resources\app.asar\editor\page\project-scripts.js:1:589)
at E:\IMI4197\CCDocument\WalkingGunner\temp\quick-scripts\assets\scripts\manager\EnemyMgr.js:1:359
at __define (E:\IMI4197\CCDocument\WalkingGunner\temp\quick-scripts\assets\scripts\manager\EnemyMgr.js:7:15)
at E:\IMI4197\CCDocument\WalkingGunner\temp\quick-scripts\assets\scripts\manager\EnemyMgr.js:160:13



require的脚本是存在的 它报错说不存在的window文件也是存在的…这个报错是为什么…

神奇…我脚本自己import了一个玩意

import { __esModule } from “…/…/…/build/wechatgame/libs/weapp-adapter/window”;

删除后问题解决…大家当没事发生过。

2赞

我也出现这个问题了,不太明白这是怎么回事?

敲代码的时候不小心敲错了 然后脚本自动在头部import了点别的东西 但是运行时候又找不到这个东西 所以就报错了。检查下所有脚本的头部有没有import点陌生的玩意 有就删去 应该就可以了…

我也是出现这个问题,但是删除了后微信开发者工具可以打开,微信打不开

emm 你这个问题我没遇到过啊… 感觉不是同一个问题?我这种是预览就直接出现问题了。