tpenaranda / vue-cryptojs

A small wrapper for integrating crypto-js into VueJS
Other
18 stars 8 forks source link

Unable to import/use in Vue3 #15

Closed matteusbatterie closed 2 years ago

matteusbatterie commented 2 years ago

As for the context of why I'm trying to use vue-cryptojs is to receive an encrypted data from URL params, then display the data decrypted on the page. First, I ran npm install vue-cryptojs command how was it oriented by your README document and rightly after I imported and added the plugin to the Vue instance, as the following:

main.js file:

// Code revised in order to maintain objectivity
import { createApp } from 'vue';
import CryptoJS from 'vue-cryptojs'
import App from './App.vue';

const app = createApp(App);
app.use(CryptoJS);

app.mount('#app');

This is the error when I run my app, without any further changes:

Image
Text Log ``` vue-cryptojs.min.js?b73b:1 Uncaught TypeError: Object.defineProperties called on non-object at Function.defineProperties () at Object.install (webpack-internal:///./node_modules/vue-cryptojs/dist/vue-cryptojs.min.js:1) at Object.use (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:3244) at eval (webpack-internal:///./src/main.js:43) at Module../src/main.js (app.js:1371) at __webpack_require__ (app.js:854) at fn (app.js:151) at Object.1 (app.js:1468) at __webpack_require__ (app.js:854) at checkDeferredModules (app.js:46) ```

Maybe that's subject for another issue, but also I'm unsure about how I'd use it on my SFC components since we are using Vue 3's Composition API (I don't know if that makes any difference) and also the introduced syntax sugar Githubissues.

  • Githubissues is a development platform for aggregating issues.