laurens94 / vue-timeline-chart

A timeline component for Vue3
https://laurens94.github.io/vue-timeline-chart/
MIT License
32 stars 2 forks source link

Module not found: Error: Default condition should be last one #7

Closed anortesn closed 4 months ago

anortesn commented 4 months ago

Hi, trying to install the library I am getting this error:

Module not found: Error: Default condition should be last one

It seems on package.json we need to change the default key to be the last one:

  "types": "./dist/types/index.d.ts",
  "exports": {
    ".": {
      "import": {        
        "types": "./dist/types/index.d.ts",
        "default": "./dist/vue-timeline-chart.js"   <----- This was above
      },
      "require": {
        "types": "./dist/types/index.d.ts",
        "default": "./dist/vue-timeline-chart.umd.cjs" <----- This was above
      }
    },

node -v v20.13.1 npm -v 10.5.2

That seems to fix it ;)

laurens94 commented 4 months ago

Hi! Thanks for opening this issue.

I modified the exports in the latest version so it should be fixed :)

Out of curiosity, when do you get this error? While installing the library using npm or when importing it in a Vue application? Also what kind of setup do you use, Vite? Firebase?

anortesn commented 4 months ago

Hi @laurens94 , by the way great work!

This is happening when importing the library in my Vue application. npm runs ok when installing. It is a standard vue3 js composition app.