iTXTech / mirai-js

强大的 Mirai JavaScript 插件运行时
GNU Affero General Public License v3.0
86 stars 33 forks source link

加载example示例时出错 #12

Closed BobH233 closed 2 years ago

BobH233 commented 2 years ago
2021-12-30 23:27:24 E/org.itxtech.miraijs.MiraiJs: Error while loading plugin TestPlugin(me.myname.testplugin) by PluginAuthor.
Detail: org.mozilla.javascript.EcmaError: ReferenceError: "mirai" is not defined. (me.myname.testplugin#main#39)
        at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:4280)
        at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:4258)
        at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:4348)
        at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1946)
        at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1769)
        at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
        at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412)
        at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578)
        at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:121)
        at org.itxtech.miraijs.PluginScope$execute$1.invokeSuspend(PluginScope.kt:78)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)

是先把zip放到data\org.itxtech.miraijs\plugins,然后启动的mirai,然后提示"mirai" is not defined.

StageGuard commented 2 years ago

example有点问题,应该是 net.mamoe.mirai 而不是 mirai。稍后我会改一下。

BobH233 commented 2 years ago

Ok