AlexzanderFlores / WOKCommands

132 stars 61 forks source link

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

Open hotuns opened 2 years ago

hotuns commented 2 years ago

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?