tailwindcss-opentype icon indicating copy to clipboard operation
tailwindcss-opentype copied to clipboard

Type errors when using in tailwind.config.mjs

Open joeldbirch opened this issue 2 years ago • 1 comments

Hello, nice looking plugin, thank you!

I'm getting errors when attempting to add this plugin to my tailwind.config.mjs file. I assume it's something incompatible with the CommonJS format of the imported file.

// @ts-check
import opentype from 'tailwindcss-opentype'

// ...
{
  // ... rest of config here

  plugins: [
    opentype
  ]
}

The error is:

Type 'typeof import("/some/path/node_modules/tailwindcss-opentype/dist/index")' is not assignable to type 'PluginCreator | { handler: PluginCreator; config?: Partial<Config>; } | { (options: any): { handler: PluginCreator; config?: Partial<...>; }; __isOptionsFunction: true; }'.ts(2322)

joeldbirch avatar May 02 '23 23:05 joeldbirch

@joeldbirch Thanks, nice to know someone else finds it useful!

I didn't realise Tailwind allowed JS module config formats now, I'll look into this...

stormwarning avatar May 04 '23 15:05 stormwarning