cmseguin / rollup-plugin-react-scoped-css

A rollup plugin designed to allow scoped css to be run in react (Compatible with vite and rollup)
38 stars 6 forks source link

rollup-plugin-react-scoped-css and vite 5.x Compatibility problem #57

Open wmx-us opened 6 months ago

wmx-us commented 6 months ago

Type 'VitePartialPlugin[]' is not assignable to type 'PluginOption'. Type 'VitePartialPlugin[]' is not assignable to type 'PluginOption[]'. Type 'VitePartialPlugin' is not assignable to type 'PluginOption'. Type 'VitePartialPlugin' is not assignable to type 'Plugin'. Types of property 'resolveId' are incompatible. Type 'ObjectHook<(this: PluginContext, source: string, importer: string, options: { assertions: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean; }) => ResolveIdResult | Promise<...>, {}>' is not assignable to type 'ObjectHook<(this: PluginContext, source: string, importer: string, options: { attributes: Record<string, string>; custom?: CustomPluginOptions; ssr?: boolean; isEntry: boolean; }) => ResolveIdResult | Promise<...>>'. Type '(this: PluginContext, source: string, importer: string, options: { assertions: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean; }) => ResolveIdResult | Promise<...>' is not assignable to type 'ObjectHook<(this: PluginContext, source: string, importer: string, options: { attributes: Record<string, string>; custom?: CustomPluginOptions; ssr?: boolean; isEntry: boolean; }) => ResolveIdResult | Promise<...>>'. Type '(this: PluginContext, source: string, importer: string, options: { assertions: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean; }) => ResolveIdResult | Promise<...>' is not assignable to type '(this: PluginContext, source: string, importer: string, options: { attributes: Record<string, string>; custom?: CustomPluginOptions; ssr?: boolean; isEntry: boolean; }) => ResolveIdResult | Promise<...>'. The 'this' types of each signature are incompatible. Property 'moduleIds' is missing in type 'import("d:/moonlet/workspace/cocos/web/wallet/node_modules/rollup/dist/rollup").PluginContext' but required in type 'import("d:/moonlet/workspace/cocos/web/wallet/node_modules/rollup-plugin-react-scoped-css/node_modules/rollup/dist/rollup").PluginContext'.ts(2322) rollup.d.ts(195, 2): 'moduleIds' is declared here. (alias) reactScopedCssPlugin(optionsIn?: ReactScopedCssPluginOptions): VitePartialPlugin[] import reactScopedCssPlugin No quick fixes available

image

Request assistance

cmseguin commented 6 months ago

Hi I would encourage you to try the alpha version if possible for now. I will probably release the 1.0.0 early 2024.

You could also let me know if you find any issues.

All you need to do is run npm i -D rollup-plugin-react-scoped-css@alpha

On Mon, Dec 25, 2023, 1:02 a.m. moonlet @.***> wrote:

Type 'VitePartialPlugin[]' is not assignable to type 'PluginOption'. Type 'VitePartialPlugin[]' is not assignable to type 'PluginOption[]'. Type 'VitePartialPlugin' is not assignable to type 'PluginOption'. Type 'VitePartialPlugin' is not assignable to type 'Plugin'. Types of property 'resolveId' are incompatible. Type 'ObjectHook<(this: PluginContext, source: string, importer: string, options: { assertions: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean; }) => ResolveIdResult | Promise<...>, {}>' is not assignable to type 'ObjectHook<(this: PluginContext, source: string, importer: string, options: { attributes: Record<string, string>; custom?: CustomPluginOptions; ssr?: boolean; isEntry: boolean; }) => ResolveIdResult | Promise<...>>'. Type '(this: PluginContext, source: string, importer: string, options: { assertions: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean; }) => ResolveIdResult | Promise<...>' is not assignable to type 'ObjectHook<(this: PluginContext, source: string, importer: string, options: { attributes: Record<string, string>; custom?: CustomPluginOptions; ssr?: boolean; isEntry: boolean; }) => ResolveIdResult | Promise<...>>'. Type '(this: PluginContext, source: string, importer: string, options: { assertions: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean; }) => ResolveIdResult | Promise<...>' is not assignable to type '(this: PluginContext, source: string, importer: string, options: { attributes: Record<string, string>; custom?: CustomPluginOptions; ssr?: boolean; isEntry: boolean; }) => ResolveIdResult | Promise<...>'. The 'this' types of each signature are incompatible. Property 'moduleIds' is missing in type 'import("d:/moonlet/workspace/cocos/web/wallet/node_modules/rollup/dist/rollup").PluginContext' but required in type 'import("d:/moonlet/workspace/cocos/web/wallet/node_modules/rollup-plugin-react-scoped-css/node_modules/rollup/dist/rollup").PluginContext'.ts(2322) rollup.d.ts(195, 2): 'moduleIds' is declared here. (alias) reactScopedCssPlugin(optionsIn?: ReactScopedCssPluginOptions): VitePartialPlugin[] import reactScopedCssPlugin No quick fixes available

image.png (view on web) https://github.com/cmseguin/rollup-plugin-react-scoped-css/assets/68103050/0a4f6985-9419-4052-a35a-715635609bd3

Request assistance

— Reply to this email directly, view it on GitHub https://github.com/cmseguin/rollup-plugin-react-scoped-css/issues/57, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEBOHJ2EAGCW5COECX54ALYLE6KRAVCNFSM6AAAAABBCF66QOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA2TKNJTGQZTANQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

shakedbuk123 commented 1 week ago

hey i am getting this issue as well when reunning vite 5 and the alpha 17 version