Why Pinia vs Vuex for Vue 3? [closed]

In short, Pinia’s API is much simpler and intuitive. It makes using stores a breeze, even for junior devs. It brings the benefits of Composition API, but has a structure which greatly resembles the Options API, which you’re probably familiar with: has a reactive state, equivalent of data function in Options API has getters, equivalent … Read more

Problem to use VueI18n outside a component

To use i18n with Vue 3’s composition API, but outside a component’s setup(), you can access its translation API (such as the t function) on its global property. E. g. in a file with unit-testable composition functions: // i18n/index.js import { createI18n } from ‘vue-i18n’ import en from ‘./en.json’ … export default createI18n({ datetimeFormats: {en: … Read more

[Vue warn]: Unknown custom element: – When running jest unit tests

This is how I was able to get rid of the annoying warning: Include RouterLinkStub, eg.: import { shallowMount, createLocalVue, RouterLinkStub } from ‘@vue/test-utils’; Map NuxtLink stub to RouterLinkStub const wrapper = shallowMount(TestItem, { … stubs: { NuxtLink: RouterLinkStub } }) And in case you were checking nuxt-link text or something, change: const link = … Read more

How to resolve “Error: error:0308010C:digital envelope routines::unsupported” Nodejs 18 error [duplicate]

In my case this happened in my Github Actions build pipeline when I was running npm run build. I was able to fix it by providing the following environment argument: export NODE_OPTIONS=–openssl-legacy-provider According from what I have read this node option can also be set in package.json. What I did was modifying the scripts section … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)