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

Typescript doesn't like twind.config.ts #3

Open
benmneb opened this issue May 9, 2023 · 0 comments
Open

Typescript doesn't like twind.config.ts #3

benmneb opened this issue May 9, 2023 · 0 comments

Comments

@benmneb
Copy link

benmneb commented May 9, 2023

After follwoing these instructions, https://github.com/y3km21/fresh-twindv1-plugin, the project works and runs, but the config

export default {
  ...defineConfig({
    presets: [presetAutoPrefix(), presetTailWind()],
  }),
  selfURL: import.meta.url,
} as Options;

type errors with

Conversion of type '{ selfURL: string; darkMode?: DarkModeConfig; darkColor?: DarkColor<BaseTheme & { screens: Record<string, MaybeArray<ScreenValue>>; colors: Record<...>; } & TailwindTheme> | undefined; ... 7 more ...; finalize: Finalize<...>[]; }' to type 'Options' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Types of property 'stringify' are incompatible.
    Type 'StringifyDeclaration<BaseTheme & { screens: Record<string, MaybeArray<ScreenValue>>; colors: Record<string, MaybeColorValue>; } & TailwindTheme>' is not comparable to type 'StringifyDeclaration<BaseTheme & { screens: Record<string, MaybeArray<ScreenValue>>; colors: Record<string, MaybeColorValue>; }>'.
      Types of parameters 'context' and 'context' are incompatible.
        Type 'Context<BaseTheme & { screens: Record<string, MaybeArray<ScreenValue>>; colors: Record<string, MaybeColorValue>; }>' is not comparable to type 'Context<BaseTheme & { screens: Record<string, MaybeArray<ScreenValue>>; colors: Record<string, MaybeColorValue>; } & TailwindTheme>'.
          The types returned by 'theme()' are incompatible between these types.
            Type 'BaseTheme & { screens: Record<string, MaybeArray<ScreenValue>>; colors: Record<string, MaybeColorValue>; }' is not comparable to type 'BaseTheme & { screens: Record<string, MaybeArray<ScreenValue>>; colors: Record<string, MaybeColorValue>; } & TailwindTheme'.deno-ts(2352)

Obvioulsy can just change it to as unknown as Options; but that seems more like just masking the problem.

If it makes a difference, I'm using "$fresh/": "https://deno.land/x/fresh@1.1.5/"

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