Skip to content

Vite + UserConfigFnObject + NodePackageImporter yields Types of property 'importers' are incompatible. #370

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

Open
LukaszGrela opened this issue Apr 17, 2025 · 0 comments

Comments

@LukaszGrela
Copy link

Types of property 'importers' are incompatible.
                    Type 'NodePackageImporter[]' is not assignable to type '(Importer<"async"> | FileImporter<"async"> | NodePackageImporter)[]'.
                      Type 'NodePackageImporter' is not assignable to type 'Importer<"async"> | FileImporter<"async"> | NodePackageImporter'.
export default defineConfig(()=({
    css: {
        preprocessorOptions: {
            scss: {
                api: 'modern-compiler',
                importers: [new NodePackageImporter()]
            }
        }
    },
});

vite 6.2.2, sass-embedded 1.86.3

Little bit different is when UserConfig is used directly

No overload matches this call.
  The last overload gave the following error.
    Type 'NodePackageImporter' is not assignable to type 'Importer<"async"> | FileImporter<"async"> | NodePackageImporter'.ts(2769)
index.d.ts(3625, 18): The last overload is declared here.
export default defineConfig({
    css: {
        preprocessorOptions: {
            scss: {
                api: 'modern-compiler',
                importers: [new NodePackageImporter()]
            }
        }
    },
});
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