Skip to content

Vite 8 incompatibility due to cjs default export #455

@revosw

Description

@revosw

Vite 8 released last week. See vitejs/vite#21890 for context. I respect #432 being rejected. I just wanted to contribute to the discussion, and hopefully one day we get to a point where you would consider publishing as esm.

When using Rolldown, which Vite uses as bundler, it is recommended for each library to not export default from a cjs file.

For now, inconsistentCjsInterop: true does work by restoring the old behavior. However, this is deprecated as per the migration guide. So one day it won't.

export default defineConfig({
    legacy: {
        inconsistentCjsInterop: true,
    },
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions