You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried using the simplest config following docs for intro/installation and vite guide by using: import { config } from "@tamagui/config/v3"
I get typescript errors in vite.config.ts:
ts error for config in const tamaguiConfig = tamaguiExtractPlugin(config):
Type '{ animations: AnimationDriver<{ '75ms': string; '100ms': string; '200ms': string; bouncy: string; superBouncy: string; lazy: string; medium: string; slow: string; quick: string; quicker: string; quickest: string; tooltip: string; }>; ... 9 more ...; selectionStyles: (theme: any) => { ...; } | null; }' has no properties in common with type 'Partial<TamaguiOptions>'.ts(2559)
ts error for tamaguiConfig.options in tamaguiPlugin(tamaguiConfig.options):
Argument of type 'ObjectHook<(this: MinimalPluginContext, options: InputOptions) => InputOptions | NullValue | Promise<InputOptions | NullValue>, {}> | undefined' is not assignable to parameter of type 'TamaguiOptions | undefined'.
Type '(this: MinimalPluginContext, options: InputOptions) => InputOptions | NullValue | Promise<InputOptions | NullValue>' has no properties in common with type 'TamaguiOptions'.ts(2345)
Everything works fine though, it loads in browser without errors.
Expected Behavior
There should be a way to configure vite config without adding custom tamagui.config.ts to root by using only @tamagui/config/v3, without getting typescript errors.
or this: const tamaguiConfig = tamaguiExtractPlugin(config)
should be without typescript errors when using "@tamagui/config/v3"` only.
Tamagui Version
"tamagui": "^1.93.2"
Platform (Web, iOS, Android)
Windows 11, Web, Vite
Reproduction
In vite starter:
`App.tsx` :
import { config } from "@tamagui/config/v3";
import { TamaguiProvider, createTamagui } from "tamagui";
// you usually export this from a tamagui.config.ts file
const tamaguiConfig = createTamagui(config);
// make TypeScript type everything based on your config
type Conf = typeof tamaguiConfig;
declare module "@tamagui/core" {
interface TamaguiCustomConfig extends Conf {}
}
function App() {
return (
<TamaguiProviderconfig={tamaguiConfig}>
...
</TamaguiProvider>
);
}
export default App;
vite.config.ts:
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { tamaguiExtractPlugin, tamaguiPlugin } from "@tamagui/vite-plugin";
import { config } from "@tamagui/config/v3";
const tamaguiConfig = tamaguiExtractPlugin(config);
export default defineConfig({
plugins: [
react(),
tamaguiPlugin(tamaguiConfig.options),
// OR THIS SETUP
tamaguiPlugin({
config: config,
components: ["tamagui"],
}),
],
});
Current Behavior
I tried using the simplest config following docs for intro/installation and vite guide by using:
import { config } from "@tamagui/config/v3"
I get typescript errors in
vite.config.ts
:ts error for
config
inconst tamaguiConfig = tamaguiExtractPlugin(config)
:ts error for
tamaguiConfig.options
intamaguiPlugin(tamaguiConfig.options)
:or
ts error for
config
in:Everything works fine though, it loads in browser without errors.
Expected Behavior
There should be a way to configure vite config without adding custom
tamagui.config.ts
to root by using only@tamagui/config/v3
, without getting typescript errors.In other words, this:
or this:
const tamaguiConfig = tamaguiExtractPlugin(config)
should be without typescript errors when using "@tamagui/config/v3"` only.
Tamagui Version
Platform (Web, iOS, Android)
Reproduction
vite.config.ts
:The text was updated successfully, but these errors were encountered: