PrismarineJS / prismarine-viewer

Web based viewer for servers and bots
https://prismarinejs.github.io/prismarine-viewer/
MIT License
270 stars 72 forks source link

The bot crashes with an error during installation prismarine-viewer #393

Closed glokaykuzdra closed 11 months ago

glokaykuzdra commented 1 year ago

I say right away, I use Python. I have a problem with the fact that the bot crashes when using prismarine-viewer. Everything is installed, I even reinstalled it, but an error still occurs.

mineflayer = require('mineflayer') mineflayerViewer = require('prismarine-viewer').mineflayer

The error that occurs:

Task exception was never retrieved future: <Task finished name='Task-25' coro=<Dispatcher._process_polling_updates() done, defined at C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\aiogram\dispatcher\dispatcher.py:407> exception=JavaScriptError('require', "Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'prismarine-viewer' imported from C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\javascript\js\deps.js\n at new NodeError (node:internal/errors:400:5)\n at packageResolve (node:internal/modules/esm/resolve:889:9)\n at moduleResolve (node:internal/modules/esm/resolve:938:20)\n at defaultResolve (node:internal/modules/esm/resolve:1153:11)\n at nextResolve (node:internal/modules/esm/loader:163:28)\n at ESMLoader.resolve (node:internal/modules/esm/loader:842:30)\n at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)\n at ESMLoader.import (node:internal/modules/esm/loader:525:22)\n at importModuleDynamically (node:internal/modules/cjs/loader:1151:29)\n at importModuleDynamicallyWrapper (node:internal/vm/module:438:21)")> Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 415, in _process_polling_updates for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 235, in process_updates return await asyncio.gather(tasks) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify response = await handler_obj.handler(args, *partial_data) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 283, in process_update return await self.callback_query_handlers.notify(update.callback_query) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify response = await handler_obj.handler(args, **partial_data) File "C:\Users\User\PycharmProjects\JavaBot\main.py", line 233, in callback_query mineflayer.bot_is_online(call_check[1]) File "C:\Users\User\PycharmProjects\JavaBot\mineflayer.py", line 20, in bot_is_online mineflayerViewer = require('prismarine-viewer') File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\javascript__init.py", line 37, in require return config.global_jsi.require(name, version, calling_dir, timeout=900) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\javascript\proxy.py", line 213, in call__ else self._exe.callProp( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\javascript\proxy.py", line 153, in callProp resp = self.pcall(ffid, "call", method, args, timeout=timeout, forceRefs=forceRefs) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\javascript\proxy.py", line 141, in pcall raise JavaScriptError(attr, res["error"]) javascript.errors.JavaScriptError: ('require', "Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'prismarine-viewer' imported from C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\javascript\js\deps.js\n at new NodeError (node:internal/errors:400:5)\n at packageResolve (node:internal/modules/esm/resolve:889:9)\n at moduleResolve (node:internal/modules/esm/resolve:938:20)\n at defaultResolve (node:internal/modules/esm/resolve:1153:11)\n at nextResolve (node:internal/modules/esm/loader:163:28)\n at ESMLoader.resolve (node:internal/modules/esm/loader:842:30)\n at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)\n at ESMLoader.import (node:internal/modules/esm/loader:525:22)\n at importModuleDynamically (node:internal/modules/cjs/loader:1151:29)\n at importModuleDynamicallyWrapper (node:internal/vm/module:438:21)")

rom1504 commented 11 months ago

the error is clearly that prismarine-viewer is not installed