Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: MyPuppet is not a constructor #203

Closed
huan opened this issue Aug 31, 2021 · 1 comment
Closed

TypeError: MyPuppet is not a constructor #203

huan opened this issue Aug 31, 2021 · 1 comment

Comments

@huan
Copy link
Member

huan commented Aug 31, 2021

The whole Wechaty ecosystem is moving towards ES Modules and we are refactoring the modules slowly.

See:

TypeError: MyPuppet is not a constructor

The above error message means that you are trying to load a non-ESM compatible puppet module.

Please file a new issue on that puppet repo to record the problem, and a link back to this issue will be welcome.

Solution

const puppet = new PuppetPadlocal()
const bot = new Wechaty({ puppet })

The above code should work as a workaround.

@huan
Copy link
Member Author

huan commented Oct 3, 2021

We have added compatible code for load CJS puppet modules in [email protected] or above versions.

huan added a commit to kaiyuanshe/osschat that referenced this issue Oct 3, 2021
huan added a commit that referenced this issue Oct 3, 2021
@huan huan closed this as completed Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant