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

use import wokcommands from 'wokcommands' get an error #211

Open
hotuns opened this issue Feb 21, 2022 · 0 comments
Open

use import wokcommands from 'wokcommands' get an error #211

hotuns opened this issue Feb 21, 2022 · 0 comments

Comments

@hotuns
Copy link

hotuns commented Feb 21, 2022

when i use

import WOKCommands from 'wokcommands'

......

new WOKCommands(x,x)

got an error TypeError: wokcommands_1.default is not a constructor , and WOKCommands is undefined

in package.json : https://github.com/AlexzanderFlores/WOKCommands/blob/main/package.json#L4
main is dist/index.js
but there is not ES Module : https://github.com/AlexzanderFlores/WOKCommands/blob/main/dist/index.js#L288-L289

Strange solution

import WOKCommands,{Options} from 'wokcommands'
type WokConstructor = { new(a:Client,b:Options): WOKCommands }
const wok = require('wokcommands') as WokConstructor

// is working
new wok(client, {})

Can you tell me what the problem is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant