Skip to content

TypeError : X is not a constructor (Vite.js) #83

@itag-tech

Description

@itag-tech

In a Vite 4.0.1 project, I encountered the following error.
image

My code (useAircallDialer.tsx)
image

After a few hours, the only solution we found was to add to your Vite configuration :

export default defineConfig({
  build: {
    commonjsOptions: { include: [] },
  },

  optimizeDeps: {
    disabled: false,
  },
}

I am writing this here to prevent

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