收藏
回答

XR-FRAME 引入 import XrFrame from 'XrFrame'; 报错?


按文档引入了AutoRotateSchema组件 但是编译器总会报错 重新编译会报

VM1407:9 app.js错误:

 TypeError: Cannot read property 'Component' of undefined

    at index.ts:14

    at S (WASubContext.js?t=wechat&s=1668394849882&v=2.27.1:1)

    at n (WASubContext.js?t=wechat&s=1668394849882&v=2.27.1:1)

    at app.ts:2

    at S (WASubContext.js?t=wechat&s=1668394849882&v=2.27.1:1)

    at <anonymous>:7:9

    at doWhenAllScriptLoaded (<anonymous>:88:21)

    at Object.scriptLoaded (<anonymous>:116:5)

    at Object.<anonymous> (<anonymous>:141:22)(env: Windows,mp,1.06.2211102; lib: 2.27.1)

(anonymous) @ VM1407:9

doWhenAllScriptLoaded @ VM1402:88

scriptLoaded @ VM1402:116

(anonymous) @ VM1402:141

Promise.then (async)

(anonymous) @ VM1402:162

(anonymous) @ VM1402:166

loadScripts @ assubloader.js:1

async function (async)

loadScripts @ assubloader.js:1

loadAppResourceScripts @ assubloader.js:1

(anonymous) @ appservice.app.js:5

evalScript @ VM12 subasdebug.js:1

I @ VM12 subasdebug.js:1

t.loadJsFiles @ VM12 subasdebug.js:1

batchLoadJsFiles @ WAServiceMainContext.js?t=wechat&s=1668394849882&v=2.27.1:1

loadJsFiles @ WAServiceMainContext.js?t=wechat&s=1668394849882&v=2.27.1:1

L @ WAServiceMainContext.js?t=wechat&s=1668394849882&v=2.27.1:1

(anonymous) @ WAServiceMainContext.js?t=wechat&s=1668394849882&v=2.27.1:1

Be @ WAServiceMainContext.js?t=wechat&s=1668394849882&v=2.27.1:1

(anonymous) @ WAServiceMainContext.js?t=wechat&s=1668394849882&v=2.27.1:1

(anonymous) @ WAServiceMainContext.js?t=wechat&s=1668394849882&v=2.27.1:1

l.emit @ WAServiceMainContext.js?t=wechat&s=1668394849882&v=2.27.1:1

emit @ WAServiceMainContext.js?t=wechat&s=1668394849882&v=2.27.1:1

(anonymous) @ WAServiceMainContext.js?t=wechat&s=1668394849882&v=2.27.1:1

(anonymous) @ WAServiceMainContext.js?t=wechat&s=1668394849882&v=2.27.1:1

emit @ WAServiceMainContext.js?t=wechat&s=1668394849882&v=2.27.1:1

c @ VM9 asdebug.js:10

r @ VM9 asdebug.js:10

(anonymous) @ VM1381:13

Promise.then (async)

(anonymous) @ VM1381:5

loadScripts @ assubloader.js:1

(anonymous) @ assubloader.js:1

e @ assubloader.js:1

(anonymous) @ assubloader.js:1

Promise.then (async)

e @ assubloader.js:1

(anonymous) @ assubloader.js:1

Promise.then (async)

e @ assubloader.js:1

(anonymous) @ assubloader.js:1

Promise.then (async)

e @ assubloader.js:1

(anonymous) @ assubloader.js:1

Promise.then (async)

e @ assubloader.js:1

proceedAsyncTasks @ assubloader.js:1

submitSerialAsyncTasks @ assubloader.js:1

(anonymous) @ VM1367:2

t.loadScripts @ VM9 asdebug.js:10

loadAppService @ VM9 asdebug.js:10

messagerCallback @ VM9 asdebug.js:10

(anonymous) @ VM9 asdebug.js:1

f @ VM9 asdebug.js:1

g @ VM9 asdebug.js:1

(anonymous) @ VM9 asdebug.js:1

_ws.onmessage @ VM9 asdebug.js:1

WAServiceMainContext.js?t=wechat&s=1668394849882&v=2.27.1:1 TypeError: Cannot read property 'Component' of undefined

    at index.ts:14

    at S (WASubContext.js?t=wechat&s=1668394849882&v=2.27.1:1)

    at n (WASubContext.js?t=wechat&s=1668394849882&v=2.27.1:1)

    at app.ts:2

    at S (WASubContext.js?t=wechat&s=1668394849882&v=2.27.1:1)

    at <anonymous>:7:9

    at doWhenAllScriptLoaded (<anonymous>:88:21)

    at Object.scriptLoaded (<anonymous>:116:5)

    at Object.<anonymous> (<anonymous>:141:22)(env: Windows,mp,1.06.2211102; lib: 2.27.1)

回答关注问题邀请回答
收藏

3 个回答

  • Demons
    Demons
    2022-11-15

    开发者工具是多少,基础库要2.27.2以上哟

    2022-11-15
    有用
    回复
  • Ditko
    Ditko
    2023-03-30

    有找到解决方法么 >.<


    2023-03-30
    有用
    回复
  • sunboy
    sunboy
    2023-01-06

    我在微信开发者工具中也是报错找不到xrframe 这个包,需要怎么弄?


    2023-01-06
    有用
    回复
登录 后发表内容