jonathanpmartins / v-money3

Vue3 currency input/directive mask
MIT License
103 stars 27 forks source link

Error using Vue3 and Vite #75

Open FabianMontoya opened 1 year ago

FabianMontoya commented 1 year ago

Hello, I'm getting an error when I add the library to my project build with Vite and Vue3 with TS.

"vue": "^3.2.45",
"v-money3": "^3.22.3",
"typescript": "~4.7.4",
"vite": "^3.2.4",
"vue-tsc": "^1.0.9"

When I run npm run dev cmd, I get the following error:

✘ [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/v-money3/dist/v-money3.mjs:107:22:
      107 │     w(this, "number", 0n);
          ╵                       ~~

✘ [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/v-money3/dist/v-money3.mjs:158:39:
      158 │     return i > 0 ? s = n.getNumber() * 10n ** BigInt(i) : i < 0 && (a = this.getNumber() * 10n ** BigInt(i * -1)), [a, s];
          ╵                                        ~~~

✘ [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/v-money3/dist/v-money3.mjs:158:91:
      158 │     return i > 0 ? s = n.getNumber() * 10n ** BigInt(i) : i < 0 && (a = this.getNumber() * 10n ** BigInt(i * -1)), [a, s];

image

I only run the cmd npm i v-money3 --save Later in main.ts :

import money from 'v-money3';

const app = createApp(App);

app.use(money);

And also I tryed with

import { Money3Directive } from 'v-money3';

const app = createApp(App);

app.directive('money3', Money3Directive);

And I get the same error.

Thanks in advace for check the error.

daviddesmet commented 1 year ago

Have you tried this? https://github.com/jonathanpmartins/v-money3/issues/70

FabianMontoya commented 1 year ago

Yep, and nothing changes

jonathanpmartins commented 1 year ago

Will appreciate very much if you could give me a working example with the problem.