You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { Wechaty } from 'wechaty'
^^^^^^^
SyntaxError: The requested module 'wechaty' does not provide an export named 'Wechaty'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
Node.js v18.16.0
The text was updated successfully, but these errors were encountered:
The error you're encountering is due to attempting to import Wechaty directly, which is not how the module exports it. Instead, you should use WechatyBuilder for creating instances of Wechaty. Here's how you can correctly import and use Wechaty in your project:
This approach aligns with the latest Wechaty documentation and should resolve the import error you're facing. Your Node.js version (v18.16.0) is compatible with Wechaty, as it requires Node.js version ">=16".
Additionally, be aware that the default puppet in Wechaty has recently changed. If your project depends on the default puppet, ensure you're using the correct configuration and dependencies. If issues persist, providing more details about your project setup could help in offering a more specific solution.
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
import { Wechaty } from 'wechaty'
^^^^^^^
SyntaxError: The requested module 'wechaty' does not provide an export named 'Wechaty'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
Node.js v18.16.0
The text was updated successfully, but these errors were encountered: