phosphor-icons / vue

A flexible icon family for Vue
https://phosphoricons.com
MIT License
199 stars 20 forks source link

'/@modules/vue.js' does not provide an export named 'default' when using vitejs #1

Closed Fanna1119 closed 3 years ago

Fanna1119 commented 3 years ago

I am trying to use phosphor-vue in a project that is set up with vitejs.

I tried to

//vite.config.js
optimizeDeps: {
    exclude: ['dayjs', 'phosphor-vue']
  }

But I am still getting this.

Uncaught SyntaxError: The requested module '/@modules/vue.js' does not provide an export named 'default'

procedure I followed.

npm init vite-app myapp

npm install phosphor-vue

In my template

//app.vue
<template>
  <div>
    <PhHorse />
    <PhHeart :size="32" color="hotpink" weight="fill" />
    <PhCube />
  </div>
</template>

<script>
  import { PhHorse, PhHeart, PhCube } from "phosphor-vue";
  export default {
    name: "App",
    components: {
      PhHorse,
      PhHeart,
      PhCube
    }
  };
</script>
rektdeckard commented 3 years ago

Vite is built for Vue 3.x only, and this library is not yet compatible. We're planning to add support as a separate library eventually.

asgomda commented 1 month ago

I am using the latest version as at the time of this writing and I am still facing the same issue. Is there an update to this?