Skip to content

select2 - 'default' is not exported #323

Answered by ElMassimo
glapworth asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Gareth!

It's likely that select2 is packaged in a way that confuses Rollup or Esbuild, and doesn't work as expected in ESM.

If it works in development, and you are using Vite 3, perhaps you should try using esbuild when building, with:

        build: {
          // Avoid using @rollup/plugin-commonjs
          commonjsOptions: {
            include: [],
          },
        },
        // Use esbuild at build time.
        optimizeDeps: {
          disabled: false,
        },

This is the default behavior in Vite 4.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@glapworth
Comment options

Answer selected by glapworth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants